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
the job.

On Jun 8, 3:38 am, V <viktor.n...@gmail.com> wrote:
> 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.djangoproject.com/en/dev/ref/models/options/
>
> V
>
> On Jun 7, 9:02 pm, josebrwn <joseb...@gmail.com> wrote:
>
> > 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 = patterns('django.views.generic.date_based',
> > ...
> >    (r'^$',  'archive_index', info_dict),
> > )
>
> > Would render the top 15 entries `order by featured DESC, pub_date
> > DESC`.
>
> > Any hints much appreciated, thanks!
> > Joe
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to