Skip to content

Instantly share code, notes, and snippets.

@gamesbrainiac
Created June 9, 2013 08:48
Show Gist options
  • Select an option

  • Save gamesbrainiac/5742861 to your computer and use it in GitHub Desktop.

Select an option

Save gamesbrainiac/5742861 to your computer and use it in GitHub Desktop.
Custom database field in PostManager
def category_posts(self, *args):
all_posts = self.published_posts()
for category in args:
all_posts = all_posts.filter(
categories__category_name__contains=str(category)
)
return all_posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment