當前位置: 首頁>>代碼示例>>Python>>正文


Python Event.mc_get方法代碼示例

本文整理匯總了Python中model.event.Event.mc_get方法的典型用法代碼示例。如果您正苦於以下問題:Python Event.mc_get方法的具體用法?Python Event.mc_get怎麽用?Python Event.mc_get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在model.event.Event的用法示例。


在下文中一共展示了Event.mc_get方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: post

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
 def post(self, id):
     current_user_id = self.current_user_id
     event = Event.mc_get(id)
     txt = self.get_argument('txt', '')
     if event and event.can_admin(current_user_id) and txt:
         po_event_notice_new(current_user_id, id, txt)
     self.finish('{}')
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:9,代碼來源:event.py

示例2: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def get(self, id):
        user_id = self.current_user_id
        po = self._po(user_id, id)

        if po is None:
            return
        po_zsite_id = po.zsite_id

        if po_zsite_id and po_zsite_id != self.zsite_id:
            return self.redirect(
                '%s/po/edit/%s'%(link(po_zsite_id), id)
            )
        cid = po.cid
        if cid == CID_EVENT_FEEDBACK:
            self.event = Event.mc_get(po.rid)

        if cid == CID_NOTE:
            template = 'ctrl/zsite/po/note.htm'
        else:
            template = 'ctrl/zsite/po/po.htm'
        self.render(
            template,
            po=po,
            cid=po.cid,
            pic_list=pic_list_edit(user_id, id)
        )
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:28,代碼來源:po.py

示例3: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
 def get(self, id):
     event = Event.mc_get(id)
     if event.id and event.zsite_id == self.current_user_id:
         if event.cid == EVENT_STATE_INIT:
             return self.redirect('/po/event/%s'%id)
         return self.render(event=event)
     self.redirect('/po/event')
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:9,代碼來源:po_event.py

示例4: _event

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
 def _event(self, id):
     o = Event.mc_get(id)
     if o and o.state > EVENT_STATE_RM:
         if o.zsite_id == self.zsite_id:
             return o
         return self.redirect(link(o.zsite_id)+self.request.path)
     return self.redirect('/')
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:9,代碼來源:event.py

示例5: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def get(self, id):
        po = self.po(id)
        if po is None:
            return

        zsite_id = self.zsite_id
        user_id = self.current_user_id
        can_admin = po.can_admin(user_id)
        can_view = po.can_view(user_id)

        if can_view and user_id:
            self.mark()

        cid = po.cid
        if cid == CID_PRODUCT:
            return self.redirect(po.user.link)

        if cid == CID_EVENT:
            zsite_tag_id = tag_name = None
            event = Event.mc_get(id)
            if event.state <= EVENT_STATE_TO_REVIEW:
                tag_link = '/event/to_review'
            else:
                tag_link = '/event'
        elif cid == CID_EVENT_NOTICE:
            zsite_tag_id = tag_name = None
            tag_link = '/%s'%po.rid
        else:
            zsite_tag_id, tag_name = zsite_tag_id_tag_name_by_po_id(po.user_id, id)
            if zsite_tag_id:
                tag_link = '/tag/%s' % zsite_tag_id
            else:
                tag_link = '/po/cid/%s'%cid

        prev_id, next_id = po_prev_next(
            po, zsite_tag_id
        )

        buzz_reply_hide(user_id,po.id)

        return self.render(
            self.template,
            po=po,
            can_admin=can_admin,
            can_view=can_view,
            zsite_tag_id=zsite_tag_id,
            prev_id=prev_id,
            next_id=next_id,
            tag_name=tag_name,
            tag_link=tag_link
        )
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:53,代碼來源:po_view.py

示例6: _event

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def _event(self, event_id):
        self.event_id = event_id
        self.event = event = Event.mc_get(event_id)
        current_user_id = self.current_user_id

        if not event:
            return self.redirect('/')

        if event.state < EVENT_STATE_NOW:
            return self.redirect(event.link)

        state = event_joiner_state(
            event_id, current_user_id
        )

        if state < EVENT_JOIN_STATE_YES:
            return self.redirect(event.link)

        return event
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:21,代碼來源:po_event.py

示例7: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def get(self):
        query = self.request.query
        t = alipay_url_recall(query)

        if t.for_id:
            t = Trade.get(t.for_id)

        url = SITE_URL

        if t:
            cid = t.cid
            if cid == CID_TRADE_CHARDE:
                user = Zsite.mc_get(t.to_id)
                url = '%s/money/charged/%s/%s'%(user.link, t.id, t.to_id)
            elif cid == CID_TRADE_EVENT:
                event = Event.mc_get(t.rid)
                zsite = Zsite.mc_get(event.zsite_id)
                url = '%s/event/%s/state'%(zsite.link, event.id)
            else:
                url = '/pay/result/%s'%t.id

        return self.redirect(url)
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:24,代碼來源:money.py

示例8: post

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def post(self, id=0):
        user_id = self.current_user_id

        if id:
            event = Event.mc_get(id)
            if event.zsite_id != self.current_user_id:
                return self.redirect('/%s'%id)
            can_change = event.can_change()
        else:
            event = None
            can_change = True

        event = po_event_edit_post(self, id, event, can_change, event_new_if_can_change)
        if event:
            if not id:
                id = event.id
                zsite = self.zsite
                zsite_id = zsite_id_by_zsite_user_id(zsite, user_id)
                po_new(CID_EVENT, user_id, '', STATE_SECRET, id=id, zsite_id=zsite_id)

            if event.state <= EVENT_STATE_TO_REVIEW:
                return self.redirect('/po/edit/%s'%id)
            else:
                return self.redirect('/%s'%id)
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:26,代碼來源:po_event.py

示例9: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
    def get(self, id):
        po = Po.mc_get(id)
        current_user_id = self.current_user_id
        cid = po.cid
        if po.can_view(current_user_id):
            po_pos_set(current_user_id, po)
            result = po.htm
            if cid == CID_EVENT:
                result = [result]
                event = Event.mc_get(id)
                result.append('<p>聯係電話 : %s</p>'%escape(event.phone))
                if event.transport:
                    result.append(
                        '<p>交通方式 : %s</p>'%escape(event.transport)
                    )

                if event.price:
                    result.append('<p>%s 元 / 人</p>'%event.price)


                notice_list = po_event_notice_list_by_event_id(id)
                for notice in notice_list:
                    result.append('<div class="pb14"><div><b>%s</b></div>%s</div>'%(
                        friendly_time(notice.create_time),
                        notice.name_htm
                    ))

                t = []

                if event.join_count:
                    t.append(
                        '<a href="/%s#join_count" target="_blank"><span class="mr3">%s</span>報名</a>'%(
                            event.id ,
                            event.join_count
                        )
                    )

                if event.state < EVENT_STATE_END:
                    t.append('<a href="/event/join/%s" target="_blank">報名參加</a>'%event.id)
                else:
                    nc = event_joiner_feedback_normal_count(id)
                    gc = event_joiner_feedback_good_count(id)
                    if gc:
                        t.append(
'<a href="/%s#feedback_good" target="_blank"><span class="mr3">%s</span>好評</a>'%(
                        id,
                        gc
)
                        )
                    if nc:
                        t.append(
'<a href="/%s#feedback_normal" target="_blank"><span class="mr3">%s</span>反饋</a>'%(
                        id,
                        nc
)
                        )

                if t:
                    result.append(
                        '<p>%s</p>'%(
                            ' , '.join(t)
                        )
                    )

                #if event.state == EVENT_STATE_END:
                #    result.append("")

                result = ''.join(result)
        else:
            result = ''
        self.finish(result)
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:73,代碼來源:feed.py

示例10: _event

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
 def _event(self, id):
     event = Event.mc_get(id)
     if not event:
         return self.redirect('/')
     return event
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:7,代碼來源:event.py

示例11: get

# 需要導入模塊: from model.event import Event [as 別名]
# 或者: from model.event.Event import mc_get [as 別名]
 def get(self, id):
     event = Event.mc_get(id)
     po = event.po
     self.render(po=po)
開發者ID:immissile,項目名稱:42qu_github_mirror,代碼行數:6,代碼來源:event.py


注:本文中的model.event.Event.mc_get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。