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.
What can I do to overcome this issue?
Thanks,
-jelle
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---