Skip to content

Instantly share code, notes, and snippets.

@insanemainframe
Created January 19, 2014 11:29
Show Gist options
  • Save insanemainframe/8503606 to your computer and use it in GitHub Desktop.
Save insanemainframe/8503606 to your computer and use it in GitHub Desktop.
threads = self.get_queryset().order_by('-update_time')
thread_container = []
for thread in threads:
posts = thread.posts.all()[:3]
item = dict(thread=thread, posts=posts)
thread_container.append(item)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment