Created
September 24, 2009 23:35
-
-
Save idan/193137 to your computer and use it in GitHub Desktop.
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
# urls.py | |
object_list_dict = { | |
'queryset': Post.objects.published(), | |
'paginate_by': 20, | |
} | |
# managers.py | |
class PublicManager(Manager): | |
def published(self): | |
return self.get_query_set().filter(public=True, published__lte=datetime.datetime.now()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment