def get(self, to_id=0): current_user = self.current_user current_user_id = self.current_user_id if to_id: zsite = Zsite.mc_get(to_id) else: host = self.request.host zsite = zsite_by_domain(host) if zsite: zsite_id = zsite.id cid = zsite.cid if cid in (CID_SITE, CID_COM, CID_TAG): zsite_fav_new(zsite, current_user_id) elif cid == CID_USER: follow_new(current_user_id, zsite_id) mq_buzz_follow_new(current_user_id, zsite_id) txt = self.get_argument('txt', None) if txt: if cid == CID_SITE: from model.reply import STATE_ACTIVE zsite.reply_new(current_user, txt, STATE_ACTIVE) elif cid == CID_COM: from model.po_review import po_review_new po_review_new(zsite_id, current_user_id, name) self.finish('{}')
def get(self, to_id=0): current_user = self.current_user current_user_id = self.current_user_id if to_id: zsite = Zsite.mc_get(to_id) else: host = self.request.host zsite = zsite_by_domain(host) if zsite: zsite_id = zsite.id cid = zsite.cid if cid in (CID_SITE, CID_COM, CID_TAG): zsite_fav_new(zsite, current_user_id) elif cid == CID_USER: follow_new(current_user_id, zsite_id) mq_buzz_follow_new(current_user_id, zsite_id) txt = self.get_argument("txt", None) if txt: if cid == CID_SITE: from model.reply import STATE_ACTIVE zsite.reply_new(current_user, txt, STATE_ACTIVE) elif cid == CID_COM: from model.po_review import po_review_new po_review_new(zsite_id, current_user_id, name) self.finish("{}")
def get(self, id): current_user_id = self.current_user_id zsite = Zsite.mc_get(id) if zsite: follow_new(current_user_id, id) mq_buzz_follow_new(current_user_id, id)
def get(self, id): current_user_id = self.current_user_id zsite = Zsite.mc_get(id) if zsite: cid = zsite.cid if cid == CID_TAG: zsite_fav_new(zsite, current_user_id) else: follow_new(current_user_id, id) mq_buzz_follow_new(current_user_id, id)
def get(self): user_id = self.current_user_id follow_id = int(self.get_argument('id')) res = follow_new(user_id, follow_id) self.finish({ 'status':res })
def get(self): user_id = self.current_user_id follow_id = int(self.get_argument('id')) res = follow_new(user_id, follow_id) self.finish({'status': res})