If I understand you, you suggest using my existing DetailView url which shows 
the detailed Post, but create a view which selects a random pk.

I thought of this but I don’t know how to go about creeating a view that 
selects a random pk, then applies to the existing urlpattern.

My guess is to count() the Post objects, then randomly pick one of the objects. 
Then somehow grab the primary key, post_id, and somehow insert into a 
urlpattern. Also point to the correct template. Any help appreciated!

-- 
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/493e4623-df7a-4605-8dcc-e88e2db17064%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to