If the require decorator is a "real" decorator, like all other real decorators needs to go inside the expose decorator or else the function that's exposed won't be the one that's actually called, and it won't have the right function attributes.
We definitely need to document this better. --Mark Ramm On Tue, Feb 10, 2009 at 6:05 PM, Florent Aide <[email protected]> wrote: > > On Tue, Feb 10, 2009 at 10:02 PM, Gustavo Narea <[email protected]> wrote: >> >> Hello, everybody. >> >> This is just to let you know that most of the repoze.what integration in TG2 >> applications has been moved to an independent project so that Pylons users >> can >> enjoy it too. This is *not* a backwards incompatible change and nobody has to >> update their code. >> > > since this change (or before) > > the decorator order is important: > > I had code like this: > > @require(somepredicate) > @expose(sometemplate) > def someprotectedmethod(self, *args, **kwargs): > return dict > > and this worked fine. > > now it returns: > > 404 Not Found with no info and no log on the console, if I want to > make it behave I need to have this: > > @expose(sometemplate) > @require(somepredicate) > def someprotectedmethod(self, *args, **kwargs): > return dict > > Is that normal? I may miss something but it breaks my apps big time :( > > Florent. > > > > -- Mark Ramm-Christensen email: mark at compoundthinking dot com blog: www.compoundthinking.com/blog --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
