Re: how to override ordering in date-based generic views

2009-06-12 Thread Justin Myers
On Jun 11, 6:35 pm, Joseph Brown wrote: > Hi Justin - Thanks & sorry I missed your email until just now.  I did try > that, and it's interesting: it worked for any of the date based generic > views that took a datepart parameter in the url, i.e. archive_year, > archive_month, and archive_day.  Bu

Re: how to override ordering in date-based generic views

2009-06-11 Thread Joseph Brown
Hi Justin - Thanks & sorry I missed your email until just now. I did try that, and it's interesting: it worked for any of the date based generic views that took a datepart parameter in the url, i.e. archive_year, archive_month, and archive_day. But archive_index just ignores it. Also tried addin

Re: how to override ordering in date-based generic views

2009-06-09 Thread Justin Myers
Have you tried this yet? info_dict = { 'queryset': Entry.objects.order_by(-featured), 'date_field': 'pub_date' } urlpatterns = patterns('django.views.generic.date_based', ... (r'^$', 'archive_index', info_dict), ) I haven't checked whether or not it works, but it seems like it'd do t

Re: how to override ordering in date-based generic views

2009-06-08 Thread V
if I'm not mistaken then the default ordering is used, that is given by your model's Meta class [1] otherwise, if you need a special ordering you might want to define your own model manager with a method that does just what you want, and call that method for the queryset [1]: http://docs.djangopr

how to override ordering in date-based generic views

2009-06-07 Thread josebrwn
Hi, I'm looking for a straightforward way to override the default ordering of the date-based generic view, in order to allow 'featured' entries to percolate to the top in a coltrane blog. So: info_dict = { 'queryset': Entry.objects.all(), 'date_field': 'pub_date', } urlpatterns = patte