On Mon, 2008-04-28 at 17:49 -0700, Szaijan wrote: > Thanks Malcolm. > > Is there a way to access the URL values assigned to the view names > within a view? Perhaps something less inelegant than importing > urls.py and searching for the view name in the tuple? Otherwise I've > traded hardcoding URLs into one template for hard coding them into 5+ > views.
Import the reverse() function from django.core.urlresolvers and use that like the "url" template tag (the "url" template tag is implemented using reverse()). Look at the arguments to reverse() in the code to make sure you get it right -- it's important to pass it keyword arguments because you have to omit the second position argument. Regards, Malcolm -- Save the whales. Collect the whole set. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" 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/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

