本文整理汇总了Python中event.models.Event.all方法的典型用法代码示例。如果您正苦于以下问题:Python Event.all方法的具体用法?Python Event.all怎么用?Python Event.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event.models.Event
的用法示例。
在下文中一共展示了Event.all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: events_done
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import all [as 别名]
def events_done(request):
events = Event.all().filter('progress =',100 ).order('-start_date')
c = Context({'events':events,
'kind':'done',
'loginurl':LOGIN,
'cur_user':CURUSER,
'logouturl':LOGOUT,
'is_admin':users.is_current_user_admin(),
})
return render_to_response( 'event_list.htm',c)
示例2: events_list
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import all [as 别名]
def events_list(request):
events = Event.all().order('start_date')
c = Context({
'logouturl':LOGOUT,
'loginurl':LOGIN,
'cur_user':CURUSER,
'is_admin':users.is_current_user_admin(),
'events':events,
'kind':'all',
})
return render_to_response( 'event_list.htm',c)
示例3: events_todo
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import all [as 别名]
def events_todo(request):
events = Event.all().filter(
'start_date >',today() ).filter('is_done =',False ).order('start_date')
c = Context({
'events':events,
'kind':'todo',
'loginurl':LOGIN,
'cur_user':CURUSER,
'logouturl':LOGOUT,
'is_admin':users.is_current_user_admin(),
})
return render_to_response( 'event_list.htm',c)
示例4: event
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import all [as 别名]
def event(request):
try:
ekey = request.GET['event']
# record the current event for further useage
except KeyError:
ekey = memcache.get('event')
if not ekey:
raise Http404
event = Event.get(Key(ekey))
memcache.set('event',event.key())
# get sub event of this event
se_list = Subevent.gql("where event = :1 order by start_date,end_date",event)
# check up wheather sub event is expired
for se in se_list:
if se.isexpired==False and se.end_date < today():
se.isexpired = True
se.put()
# get host's history operation on this event
history_li = History.all().filter('event =',event).order('-publish_time')
# get blogs about this event
blog_li = Blog.all().filter('event =',event )
# get myevents
myevents = Event.all()
c = Context({
'logouturl':LOGOUT,
'loginurl':LOGIN,
'cur_user':CURUSER,
'is_admin':users.is_current_user_admin(),
'event':event,
'myevents':myevents,
'se_list':se_list,
'num_se':se_list.count(20),
'history_li':history_li,
'num_history_records':history_li.count(10),
'blog_li':blog_li,
'num_blogs':blog_li.count(100),
})
return render_to_response('event.htm',c)
示例5: get_events
# 需要导入模块: from event.models import Event [as 别名]
# 或者: from event.models.Event import all [as 别名]
def get_events():
events = Event.all().order('-start_date')
return events