def po_save(self, user_id, name, txt, state, zsite_id): po = self.po if po is None: return cid = po.cid rid = po.rid po.zsite_id = zsite_id if cid == CID_WORD: if cnenlen(txt) > 140: answer_word2note(po) po.txt_set(txt) else: po.name_ = txt elif cid == CID_EVENT_FEEDBACK: event_joiner_state_set_by_good(user_id, rid, state) if txt: po.txt_set(txt) else: if not po.rid and name: po.name_ = name if txt: po.txt_set(txt) if cid in (CID_NOTE, CID_QUESTION, CID_ANSWER): if not (cid == CID_QUESTION and po.state == STATE_ACTIVE): po_state_set(po, state) po.save() return po
def post(self, id, state): po = Po.mc_get(id) state = int(state) if po: po_state_set(po, state) self.finish('{}')
def post(self, id, state): po = Po.mc_get(id) state = int(state) if po: po_state_set(po, state) self.finish("{}")