public
Description: minimalist blog app using Google App Engine
Homepage: http://teh.appspot.com
Clone URL: git://github.com/btbytes/teh.git
Search Repo:
teh / admin.py
100644 38 lines (33 sloc) 1.029 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
# encoding: utf-8
"""
admin.py
 
Created by Pradeep Gowda on 2008-05-04.
Copyright (c) 2008 Yashotech. All rights reserved.
"""
import wsgiref.handlers
 
from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.ext.webapp import template
from google.appengine.api import users
from utils import TehRequestHandler, administrator
 
class AdminHandler(TehRequestHandler):
    @administrator
    def get(self):
        self.render("templates/admin.html")
 
class EntryListHandler(TehRequestHandler):
    @administrator
    def get(self):
        self.render("templates/admin_entrylist.html")
 
class ConfigHandler(TehRequestHandler):
    @administrator
    def get(self):
        self.render("templates/config.html")
    @administrator
    def post(self):
        config = Config.all()
        config = config.fetch(1)[0]
        config.title = self.request.get("title")
        config.disqus = self.request.get("disqus")
        config.put()
        self.redirect('/')