Beispiel #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)
Beispiel #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'))
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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))
Beispiel #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))
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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')
Beispiel #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)
Beispiel #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'))
Beispiel #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')
Beispiel #22
0
 def get(self,_id):
     r,info = m_info(T_CATEGORY,_id)
     self.write(dict(status =r,data = info))
Beispiel #23
0
 def get(self, _id):
     r, info = m_info(TNews, _id)
     self.write(dict(status=r, data=info))
Beispiel #24
0
 def get(self,_id):
     r,info = m_info(T_Servercity,_id)
     self.write(dict(status =r,data = info))
Beispiel #25
0
 def get(self, _id):
     r, info = m_info(TNews, _id)
     self.write(dict(status=r, data=info))
Beispiel #26
0
 def get(self, _id):
     r, info = m_info(T_CATEGORY, _id)
     self.write(dict(status=r, data=info))
Beispiel #27
0
 def get(self):
     r, v = m_info(city.TName, self.get_argument('id'))
     self.write(dict(status=r, data=v))
Beispiel #28
0
 def get(self):
     r,v= m_info(city.TName,self.get_argument('id'))
     self.write(dict(status = r, data = v))