Commits

Anonymous committed 1e454c0

add excerpt field to new news form, update query to include news with no expires datetime

Comments (0)

Files changed (1)

c5t/news/controllers.py

     @with_trailing_slash
     @expose('c5t.news.templates.index')
     def get_all(self):
-        query_dict = dict({'parent_id':tmpl_context.parent_id, 'created_datetime': {'$lt': datetime.today()},'expires_datetime':{'$gte': datetime.today()}, '$or' : [ { 'status' : 'published' } , { 'status' : 'public' } ]})
+        query_dict = dict({'parent_id':tmpl_context.parent_id, 'created_datetime': {'$lt': datetime.today()}, '$or':[{'expires_datetime':{'$gte': datetime.today()}},{'expires_datetime':{'$gte': None}}], 'status':{'$in': ['published','public']} })
         news_list = News.query.find(query_dict)
         page = tmpl_context.current_page
         page = Page.query.get(slug='news_content')