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
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
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
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
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
5 matches
Mail list logo