Thats a matter of taste ... i use model_id

2014-06-04 14:07 GMT+01:00 Thomas Güttler <h...@tbz-pariv.de>:

> 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.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotblog.alvarezalonso.es

-- 
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/CA%2BxOsGD3ePtXWNd-D9AmZ_4mr_%3D3cS_uTi61i5Aou6n7SmZ9QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to