On Friday, June 15, 2012 3:11:22 PM UTC-4, Theron Luhn wrote:
>
> A lot of times I use the same view for both editing items and making new 
> items.  How can I determine which view name is being called?  I know I'm 
> not explaining myself very well, so to talk in code:
>
> @view_config(context=Context, name='new', renderer='edit.pt')
>> @view_config(context=Context, name='edit', renderer='edit.pt')
>> def edit(context, request):
>>     if [name is 'edit']:
>>         #Load data to edit
>>     elif [name is 'new']:
>>         #Do something else
>>     #Do more stuff
>
>
>
I believe it is available in request.matchdict['action'] -- at least if you 
are using urldispatch.

-- jason 

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/pylons-discuss/-/_fJXwMj4oKkJ.
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