当前位置: 首页>>代码示例>>Python>>正文


Python Zsite.mc_get方法代码示例

本文整理汇总了Python中model.zsite.Zsite.mc_get方法的典型用法代码示例。如果您正苦于以下问题:Python Zsite.mc_get方法的具体用法?Python Zsite.mc_get怎么用?Python Zsite.mc_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在model.zsite.Zsite的用法示例。


在下文中一共展示了Zsite.mc_get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
    def get(self, id):
        t = Trade.get(id)
        from_user = Zsite.mc_get(t.from_id)
        to_user = Zsite.mc_get(t.to_id)

        self.render(
            from_user=from_user,
            to_user=to_user,
            trade=t,
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:12,代码来源:money.py

示例2: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
 def get(self, mail):
     if mail.isdigit():
         user_id = mail
         user = Zsite.mc_get(user_id)
         if user:
             mail = mail_by_user_id(user_id)
             link = mail2link(mail)
             if user:
                 return self.render(mail=mail, link=link)
     elif EMAIL_VALID.match(mail):
         user_id = user_id_by_mail(mail)
         if user_id:
             user = Zsite.mc_get(user_id)
             verify_mail_new(user_id, user.name, mail, self.cid)
             return self.redirect('/auth/password/reset/%s'%user_id)
     self.redirect('/login')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:18,代码来源:verify.py

示例3: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
    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("{}")
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:33,代码来源:fav.py

示例4: buzz_follow_mail

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def buzz_follow_mail():
    prev_pos = kv_int.get(KV_BUZZ_FOLLOW_POS)
    c = Buzz.raw_sql(
        'select max(id) from buzz where create_time<%s', int(time()) - ONE_DAY
    )
    pos = c.fetchone()[0]
    if pos > prev_pos:
        d = defaultdict(OrderedDict)

        for i in Buzz.where(cid=CID_BUZZ_FOLLOW).where('to_id=rid').where(
            'id>%s and id<=%s', prev_pos, pos
        ):
            id = i.id
            d[i.to_id][i.from_id] = i.id

        dd = defaultdict(OrderedSet)
        for to_id, _d in d.iteritems():
            if mail_notice_state(to_id, CID_BUZZ_FOLLOW):
                min_id = buzz_pos.get(to_id)
                for from_id, id in _d.iteritems():
                    if id > min_id:
                        dd[to_id].add(from_id)


        for to_id, li in dd.iteritems():

            mail = mail_by_user_id(to_id)
            name = Zsite.mc_get(to_id).name

            for from_id in li:

                from_user = Zsite.mc_get(from_id)
                career = from_user.career
                if from_user.state >= ZSITE_STATE_VERIFY and any(career):
                    rendermail(
                        '/mail/buzz/follow_new.htm', mail, name,
                        from_user=from_user,
                        format='html',
                        subject='%s ( %s ) 关注 你' % (
                            from_user.name,
                            ' , '.join(career),
                        )
                    )
                    #sleep(0.1)

        kv_int.set(KV_BUZZ_FOLLOW_POS, pos)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:48,代码来源:buzz_follow_mail.py

示例5: _login

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
 def _login(self, user_id, mail, redirect=None):
     session = user_session(user_id)
     self.set_cookie('S', session)
     self.set_cookie('E', mail)
     if not redirect:
         current_user = Zsite.mc_get(user_id)
         redirect = LOGIN_REDIRECT%current_user.link
     self.redirect(redirect)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:10,代码来源:__init__.py

示例6: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
    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)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:10,代码来源:__init__.py

示例7: htm2po_by_po

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
    def htm2po_by_po(self):
        if self.find_dup():
            return
        txt = self.txt.rstrip()
        if not txt:
            return

        zsite = Zsite.mc_get(self.user_id)

        if zsite.cid == CID_SITE:
            group_id = zsite.id
        else:
            group_id = self.site_id

        po = po_note_new(
            self.user_id, self.title, '', STATE_RM, group_id
        )

        if not po:
            return
        po_id = po.id

        pic_list = self.pic_list

        for seq, url in enumerate(pic_list, 1):
            img = fetch_pic(url)
            if img:
                x, y = img.size
                if x < 48 and y < 48:
                    img = None

            if img:
                po_pic_new(self.user_id, po_id, img, seq)

            else:
                txt = re.sub('\s*图:%s\s*'%seq, '', txt, re.MULTILINE)

        po.txt_set(txt)

        if group_id:
            state = STATE_PO_ZSITE_SHOW_THEN_REVIEW
        else:
            state = STATE_ACTIVE

        po.state = state
        po.save()

        if po.zsite_id != po.user_id:
            zsite_tag_new_by_tag_id(po)

        po.feed_new()

        if self.state == RSS_RT_PO:
            po_show_new(po)

        mc_flush(po, po.zsite_id)

        return po
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:60,代码来源:rss_po.py

示例8: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
 def get(self):
     q = self.get_argument('q','')
     if q:
         id = autocomplete_tag.id_by_name(q)
         if id:
             from model.zsite import Zsite
             site = Zsite.mc_get(id)
             return self.redirect(site.link)
     self.finish("TODO")        
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:11,代码来源:index.py

示例9: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
 def get(self, id):
     current_user = self.current_user
     if not user_can_reply(current_user):
         self.finish('{"can_not_reply":1}')
     else:
         zsite = Zsite.mc_get(id)
         if zsite:
             post_reply(self, zsite.reply_new)
         self.finish('{}')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:11,代码来源:__init__.py

示例10: search_zsite_keyword_iter

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def search_zsite_keyword_iter():
    for i in ormiter(SearchZsite):
        id = i.id
        i.delete()
        zsite = Zsite.mc_get(id)
        if zsite and zsite.state:
            kw = zsite2keyword(zsite)
            if kw:
                yield zsite_keyword(zsite, kw)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:11,代码来源:zsite_iter.py

示例11: _sync_site_po

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def _sync_site_po(begin_id):
    ss = SiteSync.where('id>%s', begin_id).order_by('id')[0]
    if ss:
        begin_id = ss.id
        zsite = Zsite.mc_get(ZSITE_BIND_FOR_SYNC)
        if zsite:
            po = Po.mc_get(ss.po_id)
            if po:
                sync_site_po(po, zsite)
        return begin_id
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:12,代码来源:oauth_site_sync.py

示例12: log2zsite_uv_daliy

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def log2zsite_uv_daliy(days, f):
    for zsite_id, uv in log2zsite_id_uv(f):
        if not Zsite.mc_get(zsite_id):
            continue
        ZsiteUvDaily.raw_sql(
            'insert into zsite_uv_daily (zsite_id, days, uv) values (%s, %s, %s) on duplicate key update uv=%s',
            zsite_id,
            days,
            uv,
            uv,
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:13,代码来源:zsite_uv.py

示例13: _rss_post_argument

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def _rss_post_argument(self):
    url = self.get_argument('url', None)
    link = self.get_argument('link', None)
    user_id = self.get_argument('user_id', None)
    name = self.get_argument('name', None)
    auto = self.get_argument('auto', None)

    user = Zsite.mc_get(user_id)
    if not user:
        user_id = 0

    return url , link , user_id , name , auto
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:14,代码来源:rss.py

示例14: htm2po_by_po

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
def htm2po_by_po(pre):
    txt = pre.txt.rstrip()

    if not txt:
        return

    zsite = Zsite.mc_get(pre.user_id)

    if zsite.cid == CID_SITE:
        group_id = zsite.id
    else:
        group_id = pre.site_id

    rp = RssPoId.get(rss_po_id=pre.id)
    if rp:
        po = Po.mc_get(rp.po_id)
        if po:
            po.name_ = pre.title
            po.save()
    else:
        po = po_note_new(pre.user_id, pre.title, "", STATE_RM, group_id)
        if po and zsite.cid == CID_USER:
            po.rid = pre.rss_id
            po.save()

    if not po:
        return

    po_id = po.id

    if not rp:
        rss_po_id_new(zsite, pre.id, po_id)

    txt = txt_img_fetch(txt)

    po.txt_set(txt)

    if group_id:
        state = STATE_PO_ZSITE_SHOW_THEN_REVIEW
    else:
        state = STATE_ACTIVE
    po.state = state
    po.save()

    if po.zsite_id != po.user_id:
        zsite_tag_new_by_tag_id(po)

    if pre.state == RSS_RT_PO:
        po_show_new(po)

    mc_flush(po, po.zsite_id)

    return po
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:55,代码来源:htm2po.py

示例15: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get [as 别名]
    def get(self):
        admin = self.get_argument('admin', None)
        zsite_id = self.zsite_id
        zsite = Zsite.mc_get(zsite_id)

        jm = job_mail_new(zsite_id, mail_by_user_id(self.current_user_id))
        jm.state = JOB_MAIL_STATE_VERIFIED
        jm.save()
        if admin:
            self.redirect('/job/admin/mail')
        else:
            self.redirect('/job/new')
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:14,代码来源:job.py


注:本文中的model.zsite.Zsite.mc_get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。