Hey Everyone,
I am doing some updates to my site, and I have two models which contain
photos. One of these models contains photos which I have personally
took, and the other which I have favorited.
I want to to display a list on my home page which displays the most
recent objects from both of the models, in the one view (i.e. a
combined view of most recent photos & most recent favorites, ordered
chronologically)
At the moment, I am doing this with two queries, which obviously
returns two lists. The two queries are as follows:
recent_ownphotos = Photo.objects.order_by('-flickr_id')[:4]
recent_faves = Favorite.objects.order_by("-id')[:4]
How could I combine this into one view (i.e. recent_photos)?
Any help much appreciated.
Many Thanks in Advance,
Oliver Beattie
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---