~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to news/managers.py

  • Committer: Holger Rapp
  • Date: 2009-02-21 18:24:02 UTC
  • Revision ID: sirver@kallisto.local-20090221182402-k3tuf5c4gjwslbjf
Main Page contains now the same informations as before

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.db.models import Manager
 
2
import datetime
 
3
 
 
4
 
 
5
class PublicManager(Manager):
 
6
    """Returns published posts that are not in the future."""
 
7
    
 
8
    def published(self):
 
9
        return self.get_query_set().filter(status__gte=2, publish__lte=datetime.datetime.now())
 
 
b'\\ No newline at end of file'