~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to news/managers.py

  • Committer: Holger Rapp
  • Date: 2016-08-08 10:06:42 UTC
  • mto: This revision was merged to the branch mainline in revision 419.
  • Revision ID: sirver@gmx.de-20160808100642-z62vwqitxoyl5fh4
Added the apt-get update script I run every 30 days.

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'