Getting the name of a matched URL pattern

2009-07-01 Thread Nick Fishman
Hey everyone, I'm working with Django's named URL patterns, and was wondering how to fetch the name of the URL pattern that triggered the view. For example, with the following urlpatterns urlpatterns = patterns('', url(r'^archive/(\d{4})/$', archive, name="full-archive"), url(r'^archive-

Re: Getting the name of a matched URL pattern

2009-07-01 Thread greatlemer
On Jul 1, 9:56 pm, Nick Fishman wrote: > Hey everyone, > > I'm working with Django's named URL patterns, and was wondering how to > fetch the name of the URL pattern that triggered the view. For > example, with the following urlpatterns > > urlpatterns = patterns('', >     url(r'^archive/(\d{4})/

Re: Getting the name of a matched URL pattern

2009-07-02 Thread Shawn Milochik
On Jul 1, 2009, at 9:56 PM, Nick Fishman wrote: > > Hey everyone, > > I'm working with Django's named URL patterns, and was wondering how to > fetch the name of the URL pattern that triggered the view. For > example, with the following urlpatterns > > urlpatterns = patterns('', >url(r'^archi

Re: Getting the name of a matched URL pattern

2009-07-02 Thread Nick Fishman
> > Hi, > > I came across a similar problem when trying to put together my app for > handling menus (since I wanted to be able to specify menu items by url > names).  Anyway the following was the method I finally came up with > which seems to work just fine for me - > http://code.google.com/p/grea