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


Python Zsite.mc_get_list方法代码示例

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


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

示例1: post

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
    def post(self):
        arguments = parse_qs(self.request.body, True)

        link = ''
        name = ''
        auto = 1

        user_list_exist = []
        for txt, id in zip(arguments.get('txt'), arguments.get('id')):
            user_id = int(id)

            for url in txt.splitlines():
                url = url.strip()
                if url:
                    rss = rss_new(user_id, url, name, link, 0, auto)

            user_list_exist.append(user_id)
 
        if user_list_exist:
            self.render(
                '/god/rss/rss_add.htm',
                user_list_exist=Zsite.mc_get_list(user_list_exist),
                user_list_not_exist=[],
                success = True
            )
        else:
            self.rediect("/rss/add")
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:29,代码来源:rss.py

示例2: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
    def get(self, cid=0, n=1):
        if cid:
            cid = int(cid)
            if cid not in CID_ZSITE_TUPLE:
                return self.redirect('/following')

        zsite_id = self.zsite_id
        if cid:
            id_list = follow_id_list_by_from_id_cid(zsite_id, cid)
        else:
            id_list = follow_id_list_by_from_id(zsite_id)
        total = len(id_list)
        page, limit, offset = page_limit_offset(
            '/following%s-%%s' % (cid or ''),
            total,
            n,
            PAGE_LIMIT
        )
        if type(n) == str and offset >= total:
            return self.redirect('/following%s' % (cid or ''))

        id_list = id_list[offset: offset + limit]
        following = Zsite.mc_get_list(id_list)

        self.render(
            zsite_list=following,
            page=page,
            title='关注',
            path='/following%s'%(cid or '')
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:32,代码来源:follow.py

示例3: _tag_feed_next

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
def _tag_feed_next(tag_id, offset):
    feed_id = id_by_tag_admin(tag_id, offset)
    #feed_id = 1
    if feed_id:
        feed = FeedImport.get(feed_id)
        author_rm = is_rt_by_title(feed.title)
        tag_id_list = filter(bool, feed.tag_id_list.split(' '))
        tag_id_list = list(
            zip(
                [ i.name for i in Zsite.mc_get_list(tag_id_list) if i is not None],
                tag_id_list
            )
        )

        r = {
            'id':feed.id,
            'title':feed.title,
            'txt':feed.txt,
            'tag_id_list':tag_id_list,
            'author_rm':author_rm,
            'url':feed.url
        }
    else:
        r = '0'
    return r
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:27,代码来源:feed_import.py

示例4: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
    def get(self, id, n=1):
        po = self.po(id)
        if po is None:
            return

        path = '/%s/fav' % id

        total = vote_up_count(id)
        page, limit, offset = page_limit_offset(
            '%s-%%s' % path,
            total,
            n,
            PAGE_LIMIT
        )
        if type(n) == str and offset >= total:
            return self.redirect(path)

        id_list = vote_user_id_list(id, limit, offset)
        zsite_list = Zsite.mc_get_list(id_list)

        self.render(
            po=po,
            zsite_list=zsite_list,
            page=page,
            title='分享',
            path=path,
        )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:29,代码来源:po_view.py

示例5: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
 def get(self):
     id_list = SHOW_LIST
     zsite_list = filter(bool, Zsite.mc_get_list(id_list))
     self.render(
         sex=0,
         password='',
         errtip=Errtip(),
         zsite_list=zsite_list,
     )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:11,代码来源:member.py

示例6: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
 def get(self):
     id_list = SHOW_LIST
     zsite_list = filter(bool, Zsite.mc_get_list(id_list))
     current_user = self.current_user
     self.render(
         zsite_list=zsite_list,
         errtip=Errtip(),
         current_user=current_user
     )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:11,代码来源:newbie.py

示例7: _get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
def _get(self, func):
    key = self.get_argument('q', None)
    user_id = self.current_user_id
    result = []
    if user_id:
        name_dict, url_dict = func(user_id)
        id_list = zsite_by_key(key, name_dict, url_dict, 7)
        zsite_list = Zsite.mc_get_list(id_list)
        ico_url_bind_with_default(zsite_list)
        career_bind(zsite_list)

        for i in zsite_list:
            li = (i.name, ','.join(i.career), url_or_id(i.id), i.ico)
            result.append(li)
    #print result
    self.finish(jsonp(self, dumps(result)))
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:18,代码来源:j.py

示例8: reply_notice_mail

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
def reply_notice_mail(po_id, li):
    po = Po.mc_get(po_id)
    if not (po and po.zsite_id != po.user_id):
        return

    li = Zsite.mc_get_list(li)

    if not li:
        return

    pos, state = po_pos_get(po.user_id, po_id)
    #print pos
    if pos != -1:
        return

    zsite = Zsite.mc_get(po.user_id)

    if zsite and zsite.cid == CID_USER:

        mail = mail_by_user_id(po.user_id)

        if mail:

            li0 = li[0]

            name_list = [li0.name]
            name_list.extend(career_current(li0.id))
            name_title = ' , '.join(filter(bool, name_list))

            if len(li) > 1:
                subject = '%s人 回复 %s ( %s 等 )'%(
                    len(li) , po.name , name_title
                )
            else:
                subject = '%s 回复 %s'%(name_title, po.name)


            rendermail( '/mail/notice/notice_reply.htm', mail, zsite.name, format='html', subject=subject, reply_list=li, po=po, zsite=zsite)

            mail = '[email protected]'

            rendermail( '/mail/notice/notice_reply.htm', mail, zsite.name, format='html', subject=subject, reply_list=li, po=po, zsite=zsite)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:44,代码来源:notice_reply.py

示例9: post

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
    def post(self):
        name = self.get_argument('name', None)
        sex = self.get_argument('sex', '0')
        errtip = Errtip()
        current_user = self.current_user
        current_user_id = current_user.id

        info = _UserInfo.mc_get(current_user_id)
        if not (info and info.sex):
            if not(sex and int(sex) in (1, 2)):
                errtip.sex = '请选择性别'

        password = UserPassword.get(current_user_id)
        if not password:
            password = self.get_argument('password', None)
            if not password:
                errtip.password = '请输入密码'
            else:
                user_password_new(current_user_id, password)

        if name:
            current_user.name = name
            current_user.save()

        if not errtip:
            path = '/i/guide'
            user_info_new(current_user.id, sex=sex)
            return self.redirect(path)

        id_list = SHOW_LIST
        zsite_list = filter(bool, Zsite.mc_get_list(id_list))
        return self.render(
                   sex=sex,
                   name=name,
                   errtip=errtip,
                   zsite_list=zsite_list,
               )
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:39,代码来源:newbie.py

示例10: reload

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

import _env
import csv
from model.cid import CID_SITE, CID_NOTE
from zweb.orm import ormiter
from model.zsite import Zsite
from model.site_po import po_cid_count_by_zsite_id

def can_rec_site_id_list():
    result = []
    for i in ormiter(Zsite, 'cid=%s'%CID_SITE):
        zsite_id = i.id
        count = po_cid_count_by_zsite_id(zsite_id, CID_NOTE)
        if count > 5:
            result.append(zsite_id)
    return set(result)

if __name__ == '__main__':
    result = []
    for z in Zsite.mc_get_list(can_rec_site_id_list()):
        result.append([z.id, z.name])
    writer = csv.writer(open('site_id_name.csv', 'wb'), quoting=csv.QUOTE_ALL)
    writer.writerows(result)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:30,代码来源:site_makecsv.py

示例11: get

# 需要导入模块: from model.zsite import Zsite [as 别名]
# 或者: from model.zsite.Zsite import mc_get_list [as 别名]
 def get(self, mail=""):
     id_list = SHOW_LIST
     zsite_list = filter(bool, Zsite.mc_get_list(id_list))
     self.render(mail=mail, sex=0, password="", errtip=Errtip(), zsite_list=zsite_list)
开发者ID:immissile,项目名称:42qu_github_mirror,代码行数:6,代码来源:guide.py


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