本文整理匯總了Python中po.Po.raw_sql方法的典型用法代碼示例。如果您正苦於以下問題:Python Po.raw_sql方法的具體用法?Python Po.raw_sql怎麽用?Python Po.raw_sql使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類po.Po
的用法示例。
在下文中一共展示了Po.raw_sql方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: event_feedback_id_get
# 需要導入模塊: from po import Po [as 別名]
# 或者: from po.Po import raw_sql [as 別名]
def event_feedback_id_get(user_id, event_id):
c = Po.raw_sql(
'select id from po where rid=%s and cid=%s and user_id=%s and state>%s', event_id, CID_EVENT_FEEDBACK, user_id, STATE_RM
)
r = c.fetchone()
if r:
return r[0]
return 0
示例2: po_review_id_get
# 需要導入模塊: from po import Po [as 別名]
# 或者: from po.Po import raw_sql [as 別名]
def po_review_id_get(zsite_id, user_id):
c = Po.raw_sql(
'select id from po where zsite_id=%s and user_id=%s and cid=%s',
zsite_id, user_id, CID_REVIEW
)
r = c.fetchone()
if r:
return r[0]
return 0
示例3: po_recommend_id_by_rid_user_id
# 需要導入模塊: from po import Po [as 別名]
# 或者: from po.Po import raw_sql [as 別名]
def po_recommend_id_by_rid_user_id(rid, user_id):
c = Po.raw_sql(
'select id from po where rid=%s and user_id=%s and cid=%s and state = %s',
rid, user_id, CID_REC, STATE_ACTIVE
)
r = c.fetchone()
if r:
return r[0]
return 0
示例4: log_num_po_zsite
# 需要導入模塊: from po import Po [as 別名]
# 或者: from po.Po import raw_sql [as 別名]
def log_num_po_zsite():
num = Po.raw_sql('select count(1) from po where zsite_id != user_id').fetchone()[0]
log_history_new(Po, LOG_HISTORY_CID_PO_ZSITE, num )
示例5: log_num_po
# 需要導入模塊: from po import Po [as 別名]
# 或者: from po.Po import raw_sql [as 別名]
def log_num_po():
num = Po.raw_sql('select count(1) from po where zsite_id = 0').fetchone()[0]
log_history_new(Po, LOG_HISTORY_CID_PO, num)