~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to news/managers.py

  • Committer: franku
  • Date: 2016-04-18 13:29:23 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: somal@arcor.de-20160418132923-bfzkb5mvdr7l8mz4
added migrations to each app

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
 
5
5
class PublicManager(Manager):
6
 
    """Returns news posts that are:
7
 
 
8
 
       - not in the future
9
 
       - not published"""
10
 
 
 
6
    """Returns published posts that are not in the future."""
 
7
    
11
8
    def published(self):
12
 
        return self.get_queryset().exclude(status=1).filter(publish__lte=datetime.datetime.now())
 
9
        return self.get_queryset().filter(status__gte=2, publish__lte=datetime.datetime.now())
 
 
b'\\ No newline at end of file'