| |
Django developers |
I just had another thought on this:
On Apr 6, 2006, at 3:24 PM, Adrian Holovaty wrote:
> {% link 'path.to.month_view' 2005 'apr' %}
> {% link 'path.to.person_view' state='il' name='adrian' %}
(r'^people/(?P<state>\w\w)/(?P<name>\w+)/$', 'path.to.person_view'),
If a Person object had ``state`` and ``name`` attributes, you could do::
{% link path.to.person_view person %}
(where ``some_person`` is an object in the context) as a shortcut to::
{% link path.to.person_view state=person.state name=person.name %}
That way if you set up your URLconfs in a logical manner -- I'd bet
90% of my urlconfs already work this way -- the shortcut version
would Just Work™.
Jacob