What is the best practice for named URL parameter which refer to a primary key 
of a model?

I have seen many ways:

 - object_id
 - mymodel_id
 - pk
 - id
 - .....

example:

urlpatterns = [
    url(r'^article/(?P<WHAT_NAME_HERE>\d+)/$', 'article.view'),
    ...
    ]

Up to now we used "mymodel_id" but it gets boring to type in "mymodel".

This is a question about best practice:

Which do you use (and why)?


Related: https://docs.djangoproject.com/en/dev/topics/http/urls/#named-groups

  Thomas

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/538F19FF.1090209%40tbz-pariv.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to