本文整理汇总了Python中po.Po.mc_get方法的典型用法代码示例。如果您正苦于以下问题:Python Po.mc_get方法的具体用法?Python Po.mc_get怎么用?Python Po.mc_get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类po.Po
的用法示例。
在下文中一共展示了Po.mc_get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: event_kill_extra
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def event_kill_extra(from_id, event_id, po_id):
from notice import notice_event_kill_one, notice_event_kill_mail
event_po = Po.mc_get(event_id)
title = event_po.name
event = Event.mc_get(event_id)
link = event.link
po = Po.mc_get(event_id)
txt = po.name
notice_link = po.link
for i in EventJoiner.where(event_id=event_id).where('state>=%s', EVENT_JOIN_STATE_NEW):
event_joiner_no(i)
user_id = i.user_id
notice_event_kill_one(from_id, user_id, po_id)
notice_event_kill_mail(user_id, title, link, txt, notice_link)
示例2: product_rm
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def product_rm(com_id , user_id, id):
po = Po.mc_get(id)
if po and po.zsite_id == com_id and po.cid == CID_PRODUCT:
_po_rm(user_id, po)
mc_product_id_list_by_com_id.delete(com_id)
from model.po_product_show import product_show_rm
product_show_rm(po)
示例3: event_end_mail
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def event_end_mail(event):
event_id = event.id
owner_id = event.zsite_id
owner = event.zsite
po = Po.mc_get(event_id)
rendermail(
'/mail/event/event_end_owner.txt',
mail_by_user_id(owner_id),
owner.name,
title=po.name,
link=po.link,
user_link=owner.link,
price=event.price,
feedback_link='/event/feedback/%s' % event_id
)
sleep(0.1)
for user_id in event_joiner_user_id_list(event_id):
if user_id != owner_id:
user = Zsite.mc_get(user_id)
rendermail(
'/mail/event/event_end_joiner.txt',
mail_by_user_id(user_id),
user.name,
title=po.name,
link=po.link,
user_link=user.link,
feedback_link='/event/feedback/%s' % event_id
)
sleep(0.1)
示例4: event_review_yes
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def event_review_yes(id):
event = Event.mc_get(id)
#print event,id, event.state
if event and event.state <= EVENT_STATE_TO_REVIEW:
event.state = EVENT_STATE_BEGIN
event.save()
mc_flush_by_city_pid_cid(event.city_pid, event.cid)
zsite_id = event.zsite_id
event_joiner_new(id, zsite_id, EVENT_JOIN_STATE_YES)
po = Po.mc_get(id)
if po.zsite_id:
state = STATE_PO_ZSITE_SHOW_THEN_REVIEW
else:
state = STATE_ACTIVE
po_state_set(po, state)
notice_event_yes(event.zsite_id, id)
mc_event_id_list_by_zsite_id.delete('%s_%s'%(zsite_id, False))
mq_rendermail(
'/mail/event/event_review_yes.txt',
mail_by_user_id(event.zsite_id),
event.zsite.name,
link=po.link,
title=po.name,
price=event.price
)
示例5: po_event_feedback_new
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def po_event_feedback_new(user_id, name, txt, good, event_id, event_user_id):
if not name and not txt:
return
id = event_feedback_id_get(user_id, event_id)
if id:
m = Po.mc_get(id)
else:
m = po_new(CID_EVENT_FEEDBACK, user_id, name, STATE_ACTIVE, event_id)
if m:
id = m.id
mc_event_feedback_id_get.set('%s_%s' % (user_id, event_id), id)
m.feed_new()
from buzz import buzz_event_feedback_new , mq_buzz_event_feedback_owner_new
if user_id != event_user_id:
rank_new(m, event_id, CID_EVENT_FEEDBACK)
buzz_event_feedback_new(user_id, id, event_user_id)
else:
mq_buzz_event_feedback_owner_new(user_id, id)
event_joiner_state_set_by_good(user_id, event_id, good)
return m
示例6: po_recommend_new
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def po_recommend_new(rid, user_id, name, reply_id=None):
'''新建推荐'''
#判定?
rec_po = Po.mc_get(rid)
if not rec_po:
return
from po_pos import po_pos_state_buzz
po_pos_state_buzz(user_id, rec_po)
recommend = po_new(
CID_REC,
user_id,
name,
state=STATE_ACTIVE,
rid=rid
)
if recommend:
recommend.feed_new()
mc_po_recommend_id_by_rid_user_id.set(
'%s_%s'%(rid, user_id),
recommend.id
)
if reply_id:
rr = RecRep(
id=recommend.id,
reply_id=reply_id
)
rr.save()
return recommend
示例7: render_feed_by_zsite_id
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def render_feed_by_zsite_id(zsite_id, limit=MAXINT, begin_id=MAXINT):
zsite_id_list = zsite_id_list_by_follow(zsite_id)
rt_dict = defaultdict(list)
id_list = []
id = 0
for i in feed_merge_iter(zsite_id_list, limit, begin_id):
id = i.id
po = Po.mc_get(id)
if po is None:
continue
if po.cid == CID_REC:
id = po.rid
od = rt_dict[id]
user_id = po.user_id
data = (po.id, po.txt,po.user_id)
od.append(data)
else:
id = po.id
if id not in id_list:
id_list.append(id)
return render_feed_list(id_list, zsite_id, rt_dict), id
示例8: po_user_id_list
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def po_user_id_list(question_id):
question = Po.mc_get(question_id)
user_id = question.user_id
po_id_list = rank_po_id_list(question_id, CID_QUESTION, 'confidence')
po_list = Po.mc_get_list(po_id_list)
user_id_list = [i.user_id for i in po_list]
user_id_list.append(user_id)
return set(user_id_list)
示例9: notice_event_notice
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def notice_event_notice(from_id, event_id, po_id):
from event import event_joiner_user_id_list
po = Po.mc_get(event_id)
title = po.name
link = po.link
notice_po = Po.mc_get(po_id)
txt = notice_po.name
notice_link = notice_po.link
for user_id in event_joiner_user_id_list(event_id):
notice_new(from_id, user_id, CID_NOTICE_EVENT_NOTICE, po_id)
name = Zsite.mc_get(user_id).name
mail = mail_by_user_id(user_id)
rendermail('/mail/event/event_notice.txt',
mail, name,
title=title,
link=link,
txt=txt,
notice_link=notice_link,
)
示例10: fav_rm
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def fav_rm(user_id, po_id):
cid = fav_cid(user_id, po_id)
if cid:
Fav.where(user_id=user_id, po_id=po_id).delete()
mc_fav_cid.set('%s_%s' % (user_id, po_id), 0)
mc_flush_by_user_id(user_id, cid)
mc_flush_by_po_id(po_id)
po = Po.mc_get(po_id)
from po_tag import po_score_incr
po_score_incr(po, user_id, -7)
示例11: notice_event_join_yes
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def notice_event_join_yes(from_id, to_id, event_id):
n = notice_new(from_id, to_id, CID_NOTICE_EVENT_JOIN_YES, event_id)
mail = mail_by_user_id(to_id)
zsite = Zsite.mc_get(to_id)
po = Po.mc_get(event_id)
title = po.name
link = po.link
mq_rendermail('/mail/event/event_join_yes.txt',
mail, zsite.name,
link=link,
title=title
)
return n
示例12: notice_question_mail
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def notice_question_mail(notice):
from_id = notice.from_id
to_id = notice.to_id
rid = notice.rid
mail = mail_by_user_id(to_id)
name = Zsite.mc_get(to_id).name
from_name = Zsite.mc_get(from_id).name
question = Po.mc_get(rid)
rendermail('/mail/notice/notice_question.txt', mail, name,
entry=question,
from_name=from_name,
notice=notice,
)
示例13: feed_po_dict_by_db
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def feed_po_dict_by_db(id):
o = Po.mc_get(id)
cid = o.cid
rid = o.rid
d = dict(id=id, cid=cid)
if cid == CID_WORD and rid or cid == CID_ANSWER:
d.update(question_dict(rid))
else:
d['name'] = o.name
return d
示例14: fav_new
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def fav_new(user_id, po_id):
po = Po.mc_get(po_id)
if po and po.cid in PO_SHARE_FAV_CID and po.state >= STATE_ACTIVE and not fav_cid(user_id, po_id):
cid = po.cid
Fav(user_id=user_id, po_id=po_id, cid=cid).save()
mc_fav_cid.set('%s_%s' % (user_id, po_id), cid)
mc_flush_by_user_id(user_id, cid)
mc_flush_by_po_id(po_id)
po_pos_set(user_id, po)
from po_tag import po_score_incr
po_score_incr(po, user_id, 7)
mq_buzz_po_fav_new(user_id, po_id)
示例15: notice_event_join_no
# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get [as 别名]
def notice_event_join_no(from_id, to_id, event_id, txt):
cid = CID_NOTICE_EVENT_JOIN_NO
n = notice_new(from_id, to_id, cid, event_id, txt=txt)
mc_notice_last_id_by_zsite_id_cid.set('%s_%s' % (from_id, cid), n.id)
mail = mail_by_user_id(to_id)
zsite = Zsite.mc_get(to_id)
po = Po.mc_get(event_id)
title = po.name
link = po.link
mq_rendermail('/mail/event/event_join_no.txt',
mail, zsite.name,
link=link,
title=title,
reason=txt
)
return n