I think you can write something like this:
(r'^radio/playlist.xml','django.views.generic.list_detail.object_list',
dict(dict(queryset=Song.objects.order_by('?')[:30],allow_empty=true),
template_name="radio/playlist.xml"))

Regards, Dmitry Shevchenko.


-----Original Message-----
From: django-users@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Monday, May 14, 2007 5:42 PM
To: Django users
Subject: Re: urls/generic views/dict question.


Sorry I was unclear...
I'm currently using the same song_dict for both podcast and
playlist.xml, which is  'queryset': Song.objects.all(),
That's fine for the podcast. In the template I reverse sort it on
pub_date, and it's perfect.
But for playlist I want   something like:  'queryset':
Song.objects.all().order_by('?')[:30] as I don't want all of the
objects, and I need a random sample.

So, my question is, do I need to define a second dict for playlist, or
can I somehow modify song_dict in the URL line to just grab a random
30 items instead of all of them?





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to