edgarsmolow pisze:
> One more thought...
>
> Would it be necessary to add an entry to Routes for each controller?
> Or, can one (or just a few) entries be added which contain dynamic
> parts?
>
> Thanks.
> Edgar
>
>
> On Mar 30, 11:43 am, edgarsmolow <[email protected]> wrote:
>   
>> In my project, there are a number of controllers (and corresponding
>> templates) that can be grouped together since they share a common
>> purpose.  To keep things organized, I've put the controllers in a
>> subdirectory (of the controllers directory) called ai.  For example,
>> here are the locations of three controllers:
>>   /myproject/controllers/ai/q01.py
>>   /myproject/controllers/ai/q23.py
>>   /myproject/controllers/ai/w02.py
>>
>> How should Routes be set up so that the following URL is mapped to the
>> q01 controller above?
>>
>> http://www.somedomain.com/ai/q01
>>
>> Would the following be correct (assuming it's placed higher in the
>> list)?
>> map.connect('/ai/{controller}/{action}')
>>
>>
>>     
Maybe it is not the best routes but it's works:
    map.connect('/error/{action}', controller='error')
    map.connect('/error/{action}/{id}', controller='error')
...
    map.connect('/admin/page/{action}/{id}',
        controller='admin/page', action='index', id=None, _minimize=True)
    map.connect('/admin/price/{action}/{id}',
        controller='admin/price', action='index', id=None, _minimize=True)
    map.connect('/admin/mail/{action}/{id}',
        controller='admin/mail', action='index', id=None, _minimize=True)
    map.connect('/admin/client/{action}/{id}',
        controller='admin/client', action='index', id=None, _minimize=True)

    map.connect('/admin/{action}', controller='administrator', 
action='index', _minimize=True)

...
    map.connect('/', controller='home', action='index')
    map.connect('Default', '/{controller}/{action}')

if I go to /admin -> then controller=>administrator, method=>index
if I go to /admin/page -> then controller=>admin/page, method=>index

Best Regards


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to