Exemplo n.º 1
0
 def get(self):
     posts = Commomkvdb.get_topic_by_keys('recent-topic-home')[:10]
     output = self.render('index.xml', {
         'posts': posts,
         'site_updated': int(time()),
     })
     self.set_header('Content-Type', 'application/atom+xml')
     self.write(output)
Exemplo n.º 2
0
 def get(self):
     posts = Commomkvdb.get_topic_by_keys('recent-topic-home')[:10]
     output = self.render('index.xml', {
                 'posts':posts,
                 'site_updated':int(time()),
             })
     self.set_header('Content-Type','application/atom+xml')
     self.write(output)
Exemplo n.º 3
0
 def get(self):
     self.echo('home.html', {
         'title': "首页",
         'topic_objs': Commomkvdb.get_topic_by_keys('recent-topic-home'),
         'site_counts': Count.get_site_counts(),
         'newest_node': Node.get_newest(),
         'recent_node': Node.get_recent_node(),
         'hot_node': Node.get_hot_node(),
         #'recent_topic_objs': Commomkvdb.get_comment_topic_by_keys('recent-topic-home'),
         'comment_topic_objs': Commomkvdb.get_comment_topic_by_keys('recent-comment-topic-home'),
     }, layout='_layout.html')
Exemplo n.º 4
0
 def get(self, name): 
     name = name.lower()
     m_obj = Member.get_by_name(str(name))
     if m_obj:
         self.echo('member.html', {
             'title': m_obj['name'],
             'm_obj': m_obj,
             'topic_objs': Commomkvdb.get_topic_by_keys('topic-'+str(m_obj['name'])),
             'member_comment_topic_objs': Commomkvdb.get_topic_by_keys('comment-topic-'+str(m_obj['name'])),
             'newest_node': Node.get_newest(),
             'recent_node': Node.get_recent_node(),
             'hot_node': Node.get_hot_node(),
             'recent_topic_objs': Commomkvdb.get_comment_topic_by_keys('recent-topic-home'),
             'comment_topic_objs': Commomkvdb.get_comment_topic_by_keys('recent-comment-topic-home'),                
         }, layout='_layout.html')
     else:
         self.set_status(404)
         self.echo('error.html', {
             'page': '404',
             'title': "Can't find out this URL",
             'h2': 'Oh, my god!',
             'msg': 'Something seems to be lost...'
         })
Exemplo n.º 5
0
 def get(self, name):
     name = name.lower()
     m_obj = Member.get_by_name(str(name))
     if m_obj:
         self.echo('member.html', {
             'title':
             m_obj['name'],
             'm_obj':
             m_obj,
             'topic_objs':
             Commomkvdb.get_topic_by_keys('topic-' + str(m_obj['name'])),
             'member_comment_topic_objs':
             Commomkvdb.get_topic_by_keys('comment-topic-' +
                                          str(m_obj['name'])),
             'newest_node':
             Node.get_newest(),
             'recent_node':
             Node.get_recent_node(),
             'hot_node':
             Node.get_hot_node(),
             'recent_topic_objs':
             Commomkvdb.get_comment_topic_by_keys('recent-topic-home'),
             'comment_topic_objs':
             Commomkvdb.get_comment_topic_by_keys(
                 'recent-comment-topic-home'),
         },
                   layout='_layout.html')
     else:
         self.set_status(404)
         self.echo(
             'error.html', {
                 'page': '404',
                 'title': "Can't find out this URL",
                 'h2': 'Oh, my god!',
                 'msg': 'Something seems to be lost...'
             })
Exemplo n.º 6
0
 def get(self):
     self.echo(
         'home.html',
         {
             'title':
             "首页",
             'topic_objs':
             Commomkvdb.get_topic_by_keys('recent-topic-home'),
             'site_counts':
             Count.get_site_counts(),
             'newest_node':
             Node.get_newest(),
             'recent_node':
             Node.get_recent_node(),
             'hot_node':
             Node.get_hot_node(),
             #'recent_topic_objs': Commomkvdb.get_comment_topic_by_keys('recent-topic-home'),
             'comment_topic_objs':
             Commomkvdb.get_comment_topic_by_keys(
                 'recent-comment-topic-home'),
         },
         layout='_layout.html')