[Grok-dev] Custom Exception Views and application_url
rlacko at gratex.com
Tue Apr 1 02:59:49 EDT 2008
Thank you for help,
Yes you can do this, but i believe there is more "standart" way do do it
I was thingking about using layers and skins,
where my custom exception would be in my site's layer/skin so it will be evaluated just if browsing that skin
So my next question is: Is it posible to use layers and skins for this purpose ?
From: Douglas Cerna [mailto:douglascerna at yahoo.com]
Sent: Tuesday, April 01, 2008 8:18 AM
To: Lacko Roman
Cc: grok-dev at zope.org
Subject: Re: [Grok-dev] Custom Exception Views and application_url
> application_url(). I understand that there is no
> application created, but I can not create one, if I
> can not login to Grok administrator. I understand
> that this is because my custom exception view
> somehow replaced default view that popups login
I'll tell what I think and did (although I feel there
has to be a cleaner way :D).
As you say, the problem is that application_url is
trying to find an Application instance, but the
NotFound exception (the view's context) is bound to
the main root folder, not to the Application object.
So when application_url starts "scaling" up the
hierarchy, it doesn't find an Application object and
raises the "No application found" exception.
What I did (in the INotFound index view):
self.home_url = self.url(grok.getSite())
It's not a good solution, but it works in some cases
(sometimes grok.getSite() gets me to the root object
instead of the Application object). I have a feeling
(and a hope) that somebody could point us in the
definite solution here.
"... allí es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi
Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Special deal for Yahoo! users & friends - No Cost. Get a month of Blockbuster Total Access now
More information about the Grok-dev