本文整理汇总了Python中blog.models.Blog.all方法的典型用法代码示例。如果您正苦于以下问题:Python Blog.all方法的具体用法?Python Blog.all怎么用?Python Blog.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blog.models.Blog
的用法示例。
在下文中一共展示了Blog.all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: event
# 需要导入模块: from blog.models import Blog [as 别名]
# 或者: from blog.models.Blog 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)