コード例 #1
0
ファイル: fav.py プロジェクト: xqk/42qu_github_mirror
    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('{}')
コード例 #2
0
ファイル: fav.py プロジェクト: immissile/42qu_github_mirror
    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("{}")
コード例 #3
0
ファイル: __init__.py プロジェクト: xqk/42qu_github_mirror
    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)
コード例 #4
0
    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)
コード例 #5
0
    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)
コード例 #6
0
ファイル: user.py プロジェクト: immissile/42qu_github_mirror
 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
     })
コード例 #7
0
 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})