Hi,
I would like to have a list of recent flatpages. I'm doing something
like:
class LatestCmsNode(template.Node):
def render(self, context):
context['latest_cms'] = FlatPage.objects.all()[:2]
return ''
but this orders the results by url (title), and what I want is the
most recent 2 flatpages - ordered by id desc.
Is there a elegant way to do this, that's simple to understand?
Thank you!
Joe
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---