本文整理汇总了Python中model.event.Event.mc_get方法的典型用法代码示例。如果您正苦于以下问题:Python Event.mc_get方法的具体用法?Python Event.mc_get怎么用?Python Event.mc_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.event.Event
的用法示例。
在下文中一共展示了Event.mc_get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def post(self, id):
current_user_id = self.current_user_id
event = Event.mc_get(id)
txt = self.get_argument('txt', '')
if event and event.can_admin(current_user_id) and txt:
po_event_notice_new(current_user_id, id, txt)
self.finish('{}')
示例2: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self, id):
user_id = self.current_user_id
po = self._po(user_id, id)
if po is None:
return
po_zsite_id = po.zsite_id
if po_zsite_id and po_zsite_id != self.zsite_id:
return self.redirect(
'%s/po/edit/%s'%(link(po_zsite_id), id)
)
cid = po.cid
if cid == CID_EVENT_FEEDBACK:
self.event = Event.mc_get(po.rid)
if cid == CID_NOTE:
template = 'ctrl/zsite/po/note.htm'
else:
template = 'ctrl/zsite/po/po.htm'
self.render(
template,
po=po,
cid=po.cid,
pic_list=pic_list_edit(user_id, id)
)
示例3: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self, id):
event = Event.mc_get(id)
if event.id and event.zsite_id == self.current_user_id:
if event.cid == EVENT_STATE_INIT:
return self.redirect('/po/event/%s'%id)
return self.render(event=event)
self.redirect('/po/event')
示例4: _event
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def _event(self, id):
o = Event.mc_get(id)
if o and o.state > EVENT_STATE_RM:
if o.zsite_id == self.zsite_id:
return o
return self.redirect(link(o.zsite_id)+self.request.path)
return self.redirect('/')
示例5: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self, id):
po = self.po(id)
if po is None:
return
zsite_id = self.zsite_id
user_id = self.current_user_id
can_admin = po.can_admin(user_id)
can_view = po.can_view(user_id)
if can_view and user_id:
self.mark()
cid = po.cid
if cid == CID_PRODUCT:
return self.redirect(po.user.link)
if cid == CID_EVENT:
zsite_tag_id = tag_name = None
event = Event.mc_get(id)
if event.state <= EVENT_STATE_TO_REVIEW:
tag_link = '/event/to_review'
else:
tag_link = '/event'
elif cid == CID_EVENT_NOTICE:
zsite_tag_id = tag_name = None
tag_link = '/%s'%po.rid
else:
zsite_tag_id, tag_name = zsite_tag_id_tag_name_by_po_id(po.user_id, id)
if zsite_tag_id:
tag_link = '/tag/%s' % zsite_tag_id
else:
tag_link = '/po/cid/%s'%cid
prev_id, next_id = po_prev_next(
po, zsite_tag_id
)
buzz_reply_hide(user_id,po.id)
return self.render(
self.template,
po=po,
can_admin=can_admin,
can_view=can_view,
zsite_tag_id=zsite_tag_id,
prev_id=prev_id,
next_id=next_id,
tag_name=tag_name,
tag_link=tag_link
)
示例6: _event
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def _event(self, event_id):
self.event_id = event_id
self.event = event = Event.mc_get(event_id)
current_user_id = self.current_user_id
if not event:
return self.redirect('/')
if event.state < EVENT_STATE_NOW:
return self.redirect(event.link)
state = event_joiner_state(
event_id, current_user_id
)
if state < EVENT_JOIN_STATE_YES:
return self.redirect(event.link)
return event
示例7: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self):
query = self.request.query
t = alipay_url_recall(query)
if t.for_id:
t = Trade.get(t.for_id)
url = SITE_URL
if t:
cid = t.cid
if cid == CID_TRADE_CHARDE:
user = Zsite.mc_get(t.to_id)
url = '%s/money/charged/%s/%s'%(user.link, t.id, t.to_id)
elif cid == CID_TRADE_EVENT:
event = Event.mc_get(t.rid)
zsite = Zsite.mc_get(event.zsite_id)
url = '%s/event/%s/state'%(zsite.link, event.id)
else:
url = '/pay/result/%s'%t.id
return self.redirect(url)
示例8: post
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def post(self, id=0):
user_id = self.current_user_id
if id:
event = Event.mc_get(id)
if event.zsite_id != self.current_user_id:
return self.redirect('/%s'%id)
can_change = event.can_change()
else:
event = None
can_change = True
event = po_event_edit_post(self, id, event, can_change, event_new_if_can_change)
if event:
if not id:
id = event.id
zsite = self.zsite
zsite_id = zsite_id_by_zsite_user_id(zsite, user_id)
po_new(CID_EVENT, user_id, '', STATE_SECRET, id=id, zsite_id=zsite_id)
if event.state <= EVENT_STATE_TO_REVIEW:
return self.redirect('/po/edit/%s'%id)
else:
return self.redirect('/%s'%id)
示例9: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self, id):
po = Po.mc_get(id)
current_user_id = self.current_user_id
cid = po.cid
if po.can_view(current_user_id):
po_pos_set(current_user_id, po)
result = po.htm
if cid == CID_EVENT:
result = [result]
event = Event.mc_get(id)
result.append('<p>联系电话 : %s</p>'%escape(event.phone))
if event.transport:
result.append(
'<p>交通方式 : %s</p>'%escape(event.transport)
)
if event.price:
result.append('<p>%s 元 / 人</p>'%event.price)
notice_list = po_event_notice_list_by_event_id(id)
for notice in notice_list:
result.append('<div class="pb14"><div><b>%s</b></div>%s</div>'%(
friendly_time(notice.create_time),
notice.name_htm
))
t = []
if event.join_count:
t.append(
'<a href="/%s#join_count" target="_blank"><span class="mr3">%s</span>报名</a>'%(
event.id ,
event.join_count
)
)
if event.state < EVENT_STATE_END:
t.append('<a href="/event/join/%s" target="_blank">报名参加</a>'%event.id)
else:
nc = event_joiner_feedback_normal_count(id)
gc = event_joiner_feedback_good_count(id)
if gc:
t.append(
'<a href="/%s#feedback_good" target="_blank"><span class="mr3">%s</span>好评</a>'%(
id,
gc
)
)
if nc:
t.append(
'<a href="/%s#feedback_normal" target="_blank"><span class="mr3">%s</span>反馈</a>'%(
id,
nc
)
)
if t:
result.append(
'<p>%s</p>'%(
' , '.join(t)
)
)
#if event.state == EVENT_STATE_END:
# result.append("")
result = ''.join(result)
else:
result = ''
self.finish(result)
示例10: _event
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def _event(self, id):
event = Event.mc_get(id)
if not event:
return self.redirect('/')
return event
示例11: get
# 需要导入模块: from model.event import Event [as 别名]
# 或者: from model.event.Event import mc_get [as 别名]
def get(self, id):
event = Event.mc_get(id)
po = event.po
self.render(po=po)