django-1.3

How to specify something other than pk or slug for DetailView

How to specify something other than pk or slug for DetailView Question: I was wondering if it was possible to use something besides a pk or slug when you are using a DetailView in Django 1.3. For example, I currently have: url(r’^mymodel/(?P<pk>d+)/$’, MyDetailView.as_view()) as my url. Say I wanted something like: url(r’^mymodel/(?P<name>d+)/$’, MyDetailView.as_view()) where name …

Total answers: 2