def mc_flush(self): if not hasattr(self, '_mc_flush'): if self._new_record: rid = self.rid if rid: from model.po_question import answer_count answer_count.delete(rid) mc_feed_tuple.delete(rid) else: id = self.id mc_htm.delete(id) mc_feed_tuple.delete(id) mc_feed_po_dict.delete(id) if self.cid == CID_EVENT: from model.event import mc_event_joiner_by_owner_id mc_event_joiner_by_owner_id.delete(self.user_id) self._mc_flush = True
def event_new_if_can_change( zsite_id, cid, city_pid, pid, address, transport, begin_time, end_time, cent, limit_up, limit_down, phone, pic_id, id=None ): if id: event = Event.mc_get(id) if event and not event.can_change(): event.phone = phone event.pic_id = pic_id event.limit_up = limit_up event.limit_down = limit_down event.save() return event mc_feed_po_dict.delete(id) return event_new( zsite_id, cid, city_pid, pid, address, transport, begin_time, end_time, cent, limit_up, limit_down, phone, pic_id, id=id )
def event_new_if_can_change(zsite_id, cid, city_pid, pid, address, transport, begin_time, end_time, cent, limit_up, limit_down, phone, pic_id, id=None): if id: event = Event.mc_get(id) if event and not event.can_change(): event.phone = phone event.pic_id = pic_id event.limit_up = limit_up event.limit_down = limit_down event.save() return event mc_feed_po_dict.delete(id) return event_new(zsite_id, cid, city_pid, pid, address, transport, begin_time, end_time, cent, limit_up, limit_down, phone, pic_id, id=id)