Hi Nathaniel, I just cleaned up my implementation and posted it (along with some usage notes) at http://demo.apture.com/demo/ifactive.py .
I modified it from my original implementation, so now it doesn't require patching Django. It does require adding a middleware class, though. Although, if people wanted to patch Django for this, then it wouldn't need a middleware. It seems pretty generic to me, and it uses the same syntax for specifying views as the {% url %} tag, so it seems to me like it's pretty easy to use. -Jesse On Oct 17, 5:47 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > On Oct 16, 8:29 pm, Jesse Young <[EMAIL PROTECTED]> wrote: > > > My idea (implemented in my local version of Django) was to > > modify RegexURLResolver to return the urlpattern that was used, and > > store that (as well as the kwargs) as a property of the request. > > > Does this seem like a useful patch? Or is there a better way to > > accomplish this? > > I would love to see your implementation; it sounds like an > interesting, generic solution. > > Comparing URL paths with regex is complicated and error-prone if you > have multiple levels of navigation, and setting a <body> class > requires huge, sprawling CSS selector stanzas that is hard to > maintain. The method I currently use is putting {% block > specific_section_name %} in all the navigation links to later override > with class="active" in specific templates, but that can be a lot of > typing, and can make for noisy templates, ugly HTML, and makes generic > templates more difficult. > > - whiteinge --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---