jelle wrote: > Hi, > > I'm using the tagging app to construct a view where the most recent > articles by tag are shown, ordered by date. > To do so I use the following code: > > all_tags = set([i.name for i in Tag.objects.all()]) > articles = [] > for i in all_tags: > qs = TaggedItem.objects.get_by_model( Article, i ) > if qs: > articles.append(qs.latest('date')) > > articles = sorted(articles, key=operator.attrgetter('date')) > > When running this in the shell, it results in the wanted ordering. > When rendered in html, I loose this precise ordering.
If you use the same code in your view as above then the ordering should not change. How are you displaying in template? Should be using something like {% for article in articles %} stuff {% endfor %) -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___________________________________________________________________________ You've got fun! Check out Austin360.com for all the entertainment info you need to live it up in the big city! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---