def _pic_no(id, admin_id): from ico import ico, ico96 pic = Pic.get(id) if pic: pic.admin_id = admin_id pic.state = 0 pic.save() cid = pic.cid #print pic.cid if cid == CID_ICO: user_id = pic.user_id if ico.get(user_id) == pic.id: ico.set(user_id, 0) ico96.set(user_id, 0) mq_pic_rm_mail(id) return user_id
cid = pic.cid user_id = pic.user_id template = PIC_RM_TEMPLATE.get(cid) if template: user = Zsite.mc_get(user_id) name = user.name mail = mail_by_user_id(user_id) if cid == CID_ICO: if not ico.get(user_id): rendermail( template, mail, name, user=user, ) from mq import mq_client mq_pic_rm_mail = mq_client(pic_rm_mail) if __name__ == '__main__': #for i in Pic.where(user_id=10005704): #print i.id, i.cid from ico import ico print ico.get(10000645) ico.set(10000645,788)