On Thu, Apr 26, 2012 at 9:12 PM, Moritz Schlarb <[email protected]> wrote: > Alessandro, > > I just ran into an issue with tgext.crud, since it generates pager links > based on self._mount_point(). > They look like they would have been generated from the last statically > dispatched controller, so there are some parts missing. > > In tgext/crud/controller.py, line 144, you could probably replace > tg.dispatched_controller().mount_point > with > request.controller_state.controller.mount_point >
mount_point would return None for a non statically mounted controller, so it won't probably solve the issue. If the issue is caused by the fact that you need to allocate the controllers with some options you can use cached_property to make it behave as it was statically mounted. Take a look at https://bitbucket.org/_amol_/tgapp-photos/src/81288e064f75/photos/controllers/root.py to see what I mean. If you really need to serve the controllers from _lookup you must override _mount_point to use request.path_info Something like request.path_info[len(tg.dispatched_controller().mount_point):].split('/')[0] might be the way to go, but I don't have any ready made snippet for something like that as I always served crud rest controllers from statically mounted places or cached properties. -- You received this message because you are subscribed to the Google Groups "TurboGears" 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?hl=en.

