Esempio n. 1
0
    def get(self, _id=None):
        r, v = m_info(TProject, _id)

        ur, uv = m_info(T_Account, v['author'])
        v['authorname'] = uv.get('nickname', None) or uv['username']

        self.render('action/projectinfo.html', info=v)
Esempio n. 2
0
    def get(self, listname=None):
        cond = {'category': listname}
        since = self.get_argument('since', None)
        r, cate = m_info(T_Category, listname, key='listname')

        r, news = m_page(TNews, since=since, **cond)
        for n in news:
            r, user = m_info(T_Account, n.get('author'))
            n['authorname'] = user.get('nickname', user.get('username'))

        self.labels = suggest(3)
        r, comments = m_page(T_Comment)
        for c in comments:
            r, n = m_info(TNews, c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')

            r, user = m_info(T_Account, c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname', user.get('username'))

        self.comments = comments
        self.render('action/newslist.html',
                    news=news,
                    since=since,
                    title=cate.get('name'))
Esempio n. 3
0
    def get(self,_id=None):
        r,v = m_info(TProject,_id)
        
        ur,uv = m_info(T_Account,v['author'])
        v['authorname'] = uv.get('nickname',None) or uv['username']

        self.render('action/projectinfo.html',info = v)
Esempio n. 4
0
    def get(self, _id=None):
        r, v = m_info(TNews, _id)

        cr, cv = m_info(T_Category, v['category'], key='listname')
        v['categoryname'] = cv['name']

        ur, uv = m_info(T_Account, v['author'])
        v['authorname'] = uv.get('nickname', None) or uv['username']

        self.render('action/newsinfo.html', info=v)
Esempio n. 5
0
 def get(self,_id=None):
     r,v = m_info(TNews,_id)
     
     cr,cv = m_info(T_Category,v['category'],key='listname')
     v['categoryname'] = cv['name']
     
     ur,uv = m_info(T_Account,v['author'])
     v['authorname'] = uv.get('nickname',None) or uv['username']
     
     self.render('action/newsinfo.html',info = v)
Esempio n. 6
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r,info = m_info(T_ACCOUNT,_id)

        self.render('admin/accountinfo.html', info = info)
Esempio n. 7
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r,info = m_info(T_Servercity,_id)

        self.render('admin/servercityinfo.html', info = info)
Esempio n. 8
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r, info = m_info(T_ACCOUNT, _id)

        self.render('admin/accountinfo.html', info=info)
Esempio n. 9
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r, info = m_info(TNews, _id)

        self.render('admin/newsinfo.html', info=info)
Esempio n. 10
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r, info = m_info(T_CATEGORY, _id)

        self.render('admin/categoryinfo.html', info=info)
Esempio n. 11
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r,info = m_info(T_CATEGORY,_id)

        self.render('admin/categoryinfo.html', info = info)
Esempio n. 12
0
    def get(self):
        _id = self.get_argument("id", None)
        info = {}
        if _id:
            r, info = m_info(TNews, _id)

        self.render("admin/newsinfo.html", info=info)
Esempio n. 13
0
    def get(self, news_id):
        since = self.get_argument("since", None)
        r, data = m_page(TComment, since=since, news_id=news_id)
        for item in data:
            r, v = m_info(T_Account, item["author"])
            if r and v:
                item["authorname"] = v.get("nickname", v["username"])

        self.write(dict(status=r, data=data))
Esempio n. 14
0
    def get(self, news_id):
        since = self.get_argument('since', None)
        r, data = m_page(TComment, since=since, news_id=news_id)
        for item in data:
            r, v = m_info(T_Account, item['author'])
            if r and v:
                item['authorname'] = v.get('nickname', v['username'])

        self.write(dict(status=r, data=data))
Esempio n. 15
0
    def get(self):
        since = self.get_argument('since',None)
        keys = self.get_arguments('key')
        cond = {'labels':{'$in':keys}}
        r,project = m_page(TProject,since=since,**cond)
        for n in project:
            r,user = m_info(T_Account,n.get('author'))
            n['authorname'] = user.get('nickname',user.get('username'))

        self.labels = suggest(3)
        self.render('action/projectlist.html',project=project,since=since, title=keys)
Esempio n. 16
0
    def get(self):
        since = self.get_argument('since', None)
        keys = self.get_arguments('key')
        cond = {'labels': {'$in': keys}}
        r, news = m_page(TNews, since=since, **cond)
        for n in news:
            r, user = m_info(T_Account, n.get('author'))
            n['authorname'] = user.get('nickname', user.get('username'))

        self.labels = suggest(3)
        r, comments = m_page(T_Comment)
        for c in comments:
            r, n = m_info(TNews, c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')

            r, user = m_info(T_Account, c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname', user.get('username'))

        self.comments = comments
        self.render('action/newslist.html', news=news, since=since, title=keys)
Esempio n. 17
0
    def get(self):
        since = self.get_argument('since',None)
        keys = self.get_arguments('key')
        cond = {'labels':{'$in':keys}}
        r,news = m_page(TNews,since=since,**cond)
        for n in news:
            r,user = m_info(T_Account,n.get('author'))
            n['authorname'] = user.get('nickname',user.get('username'))

        self.labels = suggest(3)
        r,comments = m_page(T_Comment)
        for c in comments:
            r,n = m_info(TNews,c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')
            
            r,user = m_info(T_Account,c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname',user.get('username'))

        self.comments = comments
        self.render('action/newslist.html',news=news,since=since, title=keys)
Esempio n. 18
0
    def get(self):
        self.oneday = hot(5,1)
        self.weeknews = hot(5,7)
        self.monthnews = hot(5,30)
        r,self.categorys = m_page(T_Category,size=10)        
        news = {}
        for cate in self.categorys:
            r,news[cate.get('listname')] = m_page(TNews,category=cate.get('listname'))
        
        self.news = news
        self.labels = suggest(3)
        r,comments = m_page(T_Comment)
        for c in comments:
            r,n = m_info(TNews,c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')

            r,user = m_info(T_Account,c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname',user.get('username'))
        
        self.comments = comments
        self.render('action/news.html')
Esempio n. 19
0
    def get(self):
        since = self.get_argument('since', None)
        keys = self.get_arguments('key')
        cond = {'labels': {'$in': keys}}
        r, project = m_page(TProject, since=since, **cond)
        for n in project:
            r, user = m_info(T_Account, n.get('author'))
            n['authorname'] = user.get('nickname', user.get('username'))

        self.labels = suggest(3)
        self.render('action/projectlist.html',
                    project=project,
                    since=since,
                    title=keys)
Esempio n. 20
0
    def get(self,listname=None):
        cond = {'category':listname}
        since = self.get_argument('since',None)
        r,cate = m_info(T_Category,listname,key='listname')

        r,news = m_page(TNews,since=since,**cond)
        for n in news:
            r,user = m_info(T_Account,n.get('author'))
            n['authorname'] = user.get('nickname',user.get('username'))

        self.labels = suggest(3)
        r,comments = m_page(T_Comment)
        for c in comments:
            r,n = m_info(TNews,c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')
            
            r,user = m_info(T_Account,c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname',user.get('username'))

        self.comments = comments
        self.render('action/newslist.html',news=news,since=since, title= cate.get('name'))
Esempio n. 21
0
    def get(self):
        self.oneday = hot(5, 1)
        self.weeknews = hot(5, 7)
        self.monthnews = hot(5, 30)
        r, self.categorys = m_page(T_Category, size=10)
        news = {}
        for cate in self.categorys:
            r, news[cate.get('listname')] = m_page(
                TNews, category=cate.get('listname'))

        self.news = news
        self.labels = suggest(3)
        r, comments = m_page(T_Comment)
        for c in comments:
            r, n = m_info(TNews, c.get('news_id'))
            if r and n:
                c['title'] = n.get('title')

            r, user = m_info(T_Account, c.get('author'))
            if r and user:
                c['authorname'] = user.get('nickname', user.get('username'))

        self.comments = comments
        self.render('action/news.html')
Esempio n. 22
0
 def get(self,_id):
     r,info = m_info(T_CATEGORY,_id)
     self.write(dict(status =r,data = info))
Esempio n. 23
0
 def get(self, _id):
     r, info = m_info(TNews, _id)
     self.write(dict(status=r, data=info))
Esempio n. 24
0
 def get(self,_id):
     r,info = m_info(T_Servercity,_id)
     self.write(dict(status =r,data = info))
Esempio n. 25
0
 def get(self, _id):
     r, info = m_info(TNews, _id)
     self.write(dict(status=r, data=info))
Esempio n. 26
0
 def get(self, _id):
     r, info = m_info(T_CATEGORY, _id)
     self.write(dict(status=r, data=info))
Esempio n. 27
0
 def get(self):
     r, v = m_info(city.TName, self.get_argument('id'))
     self.write(dict(status=r, data=v))
Esempio n. 28
0
 def get(self):
     r,v= m_info(city.TName,self.get_argument('id'))
     self.write(dict(status = r, data = v))