示例#1
0
 def GET(self, id):
     name = gc('name')
     article = Article.get(id)
     if article and name:
         user = get_user(name)
         return st("admin/edit.mako", **locals())
     return st("404.mako", **locals())
示例#2
0
 def GET(self, id):
     name = gc('name')
     article = Article.get(id)
     if article and name:
         user = get_user(name)
         return st("admin/edit.mako", **locals())
     return st("404.mako", **locals())
示例#3
0
 def GET(self):
     name = gc('name')
     if name:
         #return 'test'
         user = get_user(name)
         return st("admin/main.mako", **locals())
     return st("admin/login.mako", **locals())
示例#4
0
 def GET(self):
     name = gc('name')
     if name:
         #return 'test'
         user = get_user(name)
         articles = get_user_articles(user.name)
         return st("admin/manage.mako", **locals())
     return st("admin/login.mako", **locals())
示例#5
0
 def GET(self):
     name = gc('name')
     if name:
         #return 'test'
         user = get_user(name)
         articles = get_user_articles(user.name)
         return st("admin/manage.mako", **locals())
     return st("admin/login.mako", **locals())
示例#6
0
 def GET(self):
     mc_user = mc.get('users')
     if mc_user:
         users = mc_user
     else:
         users = get_users(active_users)
         has_error = False
         allrss = []
         for user in users:
             try:
                 rss = []
                 rss_url = user.rss_url
                 data = urllib.urlopen(rss_url)
                 data = data.read()
                 xml = minidom.parseString(data)
                 items = xml.getElementsByTagName('item')[:4]
                 for item in items:
                     rss_item = Rss()
                     title = get_xml_text(item.getElementsByTagName('title')[0].childNodes)
                     date = get_xml_text(item.getElementsByTagName('pubDate')[0].childNodes)
                     link = get_xml_text(item.getElementsByTagName('link')[0].childNodes)
                     rss_item.title = title.encode('utf-8')
                     rss_item.date = date.split('+')[0].encode('utf-8')
                     rss_item.link = link.encode('utf-8')
                     rss.append(rss_item)
                     allrss.append(rss_item)
                 user.rss = rss
             except:
                 has_error = True
                 user.rss = None
         if not has_error:
             mc.set('users', users, 3600 * 12)
     return st('blog.mako', **locals())
示例#7
0
 def GET(self):
     name = gc('name')
     if name:
         user = get_user(name)
         return st("admin/add.mako", **locals())
     return st("admin/login.mako", **locals())
示例#8
0
 def GET(self):
     articles = get_cate_articles(1)
     return st("news.mako", **locals())
示例#9
0
文件: add.py 项目: GuoJing/jguoer-web
 def GET(self):
     name = gc("name")
     if name:
         user = get_user(name)
         return st("admin/add.mako", **locals())
     return st("admin/login.mako", **locals())
示例#10
0
 def GET(self):
     return st("about/perfessional.mako", **locals())
示例#11
0
 def GET(self):
     content = '操作执行成功'
     return st("notify.mako", **locals())
示例#12
0
 def GET(self):
     name = gc('name')
     sc('name', '', -2)
     return st("admin/login.mako", **locals())
示例#13
0
 def GET(self):
     return st("about/work.mako", **locals())
示例#14
0
 def GET(self):
     return st("404.mako", **locals())
示例#15
0
 def GET(self):
     return st("about/work.mako", **locals())
示例#16
0
 def GET(self, name):
     article = Article.get(name)
     if article:
         return st("article.mako", **locals())
     return st("404.mako", **locals())
示例#17
0
 def GET(self, name):
     article = Article.get(name)
     if article:
         return st("article.mako", **locals())
     return st("404.mako", **locals())
示例#18
0
 def GET(self):
     return st("about/perfessional.mako", **locals())
示例#19
0
 def GET(self):
     content = 'Hello world page with mako'
     return st("main.mako", **locals())
示例#20
0
 def GET(self):
     name = gc('name')
     sc('name','',-2)
     return st("admin/login.mako", **locals())