Created
June 9, 2013 08:48
-
-
Save gamesbrainiac/5742861 to your computer and use it in GitHub Desktop.
Custom database field in PostManager
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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