entries = BlogEntry.objects.filter(status=True,sticky=False,control_tags=controlTag)[offset:(offset+limit)] sticky_entries = BlogEntry.objects.filter(status=True,sticky=True,control_tags=controlTag) entries = sticky_entries | entries
Refactorings
No refactoring yet !
Matt Wilson
April 10, 2010, April 10, 2010 09:12, permalink
# from http://www.djangosnippets.org/snippets/1103/ import MultiQuerySet entries = MultiQuerySet(sticky_entries, entries)
When i combine this way, records that have sticky flag comes unordered. I need them(items that have sticky=1) on top of queryset, any suggestions?
i <3 refactormycode :)