Пример #1
0
def json_info(user_id):
    user_id = int(user_id)
    user = Zsite.mc_get(user_id)
    namecard = namecard_get(user_id)
    user_info = UserInfo.get(user_id)
    data = {}
    if user_info:
        if user:
            data['cid'] = user.cid
            data['user_id'] = user_id
            data['self_intro'] = user.txt
            data['name'] = user.name
            data['ico'] = ico_url(user_id) or ''
            data['moto'] = motto.get(user_id)
            data['user_link'] = 'http:%s'%user.link
            data['sex'] = user_info.sex
            data['marry'] = user_info.marry
            data['follower_num'] = follow_count_by_to_id(user_id)
            data['following_num'] = follow_count_by_from_id(user_id)
            data['verify_state'] = user.state
            data['pic'] = ico.get(user_id)
            if namecard:
                if namecard.pid_now:
                    data['place_now_name'] = namecard.place_now
                    data['place_now'] = namecard.pid_now
            if user_info.pid_home:
                data['place_home_name'] = user_info.place_home
                data['place_home'] = user_info.pid_home
    return data
Пример #2
0
 def get(self):
     current_user_id = self.current_user_id
     current_user = self.current_user
     motto = _motto.get(current_user_id)
     txt = txt_get(current_user_id)
     o = UserInfo.mc_get(current_user_id) or JsDict()
     c = namecard_get(current_user_id) or JsDict()
     self.render(
         name=current_user.name,
         motto=motto,
         txt=txt,
         birthday='%08d' % (o.birthday or 0),
         marry=o.marry,
         pid_home=o.pid_home or 0,
         pid_now=c.pid_now or 0,
         sex=o.sex
     )
Пример #3
0
    def get(self, n=1):
        zsite_id = self.zsite_id
        zsite = self.zsite
        current_user_id = self.current_user_id

        if zsite.cid == CID_SITE:
            li, page = render_zsite_site(self, n)
            if current_user_id:
                if not zsite_fav_get_and_touch(zsite, current_user_id):
                    return self.redirect('/about')
            self.render('/ctrl/zsite/po_view/site_po_page.htm',
                        li=li,
                        page=page)
        elif zsite.cid == CID_COM:
            self.render('/ctrl/com/index/com.htm', user_id=current_user_id)
        elif zsite.cid == CID_TAG:
            render_tag_site(self, n)
        else:
            self.render(motto=motto.get(zsite_id))
Пример #4
0
    def get(self):
        errtip = Errtip()
        name = self.zsite.name
        com_id = self.zsite_id
        pic_id = ico96.get(com_id)
        motto = _motto.get(com_id)
        pid_add = pid_by_com_id(com_id)
        pid_add = [[i.pid, i.address] for i in pid_add]
        zc = ZsiteCom.mc_get(com_id)
        phone = None
        if zc:
            phone = zc.phone

        self.render('/ctrl/com/index/com_new.htm',
                    errtip=errtip,
                    motto=motto,
                    pic_id=pic_id,
                    name=name,
                    phone=phone,
                    pid_add=pid_add,
                    edit=True)
Пример #5
0
    def get(self, n=1):
        zsite_id = self.zsite_id
        zsite = self.zsite
        current_user_id = self.current_user_id

        if zsite.cid == CID_SITE:
            li, page = render_zsite_site(self, n)
            if current_user_id:
                if not zsite_fav_get_and_touch(zsite, current_user_id):
                    return self.redirect('/about')
            self.render(
                '/ctrl/zsite/po_view/site_po_page.htm',
                li=li, page=page
            )
        elif zsite.cid == CID_COM:
            self.render(
                    '/ctrl/com/index/com.htm',
                    user_id=current_user_id
            )
        elif zsite.cid == CID_TAG:
            render_tag_site(self, n)
        else:
            self.render( motto=motto.get(zsite_id) )
Пример #6
0
    def get(self):
        errtip = Errtip()
        name = self.zsite.name
        com_id = self.zsite_id
        pic_id = ico96.get(com_id)
        motto = _motto.get(com_id)
        pid_add = pid_by_com_id(com_id)
        pid_add = [[i.pid, i.address] for i in pid_add]
        zc = ZsiteCom.mc_get(com_id)
        phone = None
        if zc:
            phone = zc.phone


        self.render(
                    '/ctrl/com/index/com_new.htm',
                    errtip=errtip,
                    motto=motto,
                    pic_id=pic_id,
                    name=name,
                    phone=phone,
                    pid_add=pid_add,
                    edit=True)