Hi,
I wonder if there is a way to add routes after initialization time
Here is my use case. I've created a rest controller[1] in FormAlchemy
to generate a CRUD interface for a model (SA mapper or whatever).
I like to use this controller for more than one model. The goal is to
generate an admin interface. I don't know which models since they are
loaded after map initialisation.
So I like to have something like:
from pylons import config
def init_routes(models):
for m in models:
config['routes.map'].resource(...)
Is it safe ?
And if yes, where is the best place to put this stuff ? Ideally I like
to have this in the controller's module itself
Do I need to re-generate something in routes ?
I know that I can use some custom routes to reproduce .resource() for
my use case but I like to avoid this.
I really need some advices.
Regards,
[1]
http://docs.formalchemy.org/current/ext/pylons.html#module-formalchemy.ext.pylons.controller
--
Gael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---