[Grok-dev] Custom Exception Views and application_url

Douglas Cerna douglascerna at yahoo.com
Tue Apr 1 02:17:49 EDT 2008


> 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
> form.
> 

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):

    def update(self):
        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.

HTH, Douglas.


Douglas

"... 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.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html


      ____________________________________________________________________________________
Special deal for Yahoo! users & friends - No Cost. Get a month of Blockbuster Total Access now 
http://tc.deals.yahoo.com/tc/blockbuster/text3.com



More information about the Grok-dev mailing list