pombreda / formalchemy

Automatically exported from code.google.com/p/formalchemy
MIT License
0 stars 0 forks source link

can't do routing to controllers in subdirectories? #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an admin module inside a directory in the controllers directory.
2. add routing like:
 maps.admin_map(map, controller='admin/admin', url='/admin')
assuming your directory is called admin and your controller admin.py (don't
forget your __init__.py in the admin directory.
3. click on any of your models to view in /admin

What is the expected output? What do you see instead?
Expect to see model, instead get debug output with:
TypeError: __init__() got an unexpected keyword argument 'autocommit' -
this is caused due to bad routing - the modelname is misinterpreted by
routes and is passed in as 'list' (ie, the action). Variations on the route
like:
 maps.admin_map(map, controller='admin/admin', url='/admin/admin')
also fail, as the urls from the 'front page' of formalchemy all point to /admin

What version of the product are you using? On what operating system?
Running Pylons 9.7, sqlalchemy 0.5.2 (although same behaviour with 0.4.8),
and formalchemy from SVN rev 750. 

Please provide any additional information below.
Really this is a routing issue, but I didn't manage to find any way around
this other than moving the admin.py into the controllers directory.  As
we're likely to have quite a large admin panel, I wanted to keep admin
related controllers in a separate directory.

Thanks

Original issue reported on code.google.com by damiandi...@gmail.com on 21 Apr 2009 at 1:50

GoogleCodeExporter commented 9 years ago
i've added a controller option in trunk

try: FormAlchemyAdminController(klass, controller='admin/admin') in admin.py

not sure this fix the issue..

Original comment by gael.pas...@gmail.com on 21 Apr 2009 at 8:56

GoogleCodeExporter commented 9 years ago
going to mark this fixed since there has been no report of continuing problems

Original comment by jbel...@gmail.com on 16 Jun 2009 at 5:06