Hi,

The DetailView has a method "get_object" that you can override and use to
return the object via any source you choose.
You can also override the pk_url_kwarg or slug_url_kwarg properties on the
DetailView to retrieve the information from the url in any way you want.

Regards,

Andréas


Den ons 2 jan. 2019 kl 11:20 skrev Osezele Orukpe <osezel...@gmail.com>:

> I would like to know if django DetailView can be used with other fields
> apart from slug and primary key?
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d0e15758-e6d3-4f59-9229-9fc4aeb128e0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d0e15758-e6d3-4f59-9229-9fc4aeb128e0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCdP%3DO82qLcR%2BAY%2B%2Ba9LTTSHa0_0v82K4hmBiSnByTfTPg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to