-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.py
47 lines (37 loc) · 1.25 KB
/
admin.py
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
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 *-*
import os
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import pyday
from db import model
class Talks(pyday.PyDayHandler):
def get(self):
talks = model.Talk.all()
result = self.user_login()
result['talks'] = talks
path = os.path.join(os.path.dirname(__file__),
"templates/admin/talks.html")
self.response.out.write(template.render(path, result))
class Mails(pyday.PyDayHandler):
def get(self):
mails = model.Attendee.all()
result = self.user_login()
emails = '[email protected]'
for user in mails:
email = user.email
if '@' not in email:
email = '%[email protected]' % email
emails = '%s, %s' % (emails, email)
result['mails'] = emails
path = os.path.join(os.path.dirname(__file__),
"templates/admin/mails.html")
self.response.out.write(template.render(path, result))
def main():
application = webapp.WSGIApplication([
('/talks', Talks),
('/mails', Mails),
], debug=True)
run_wsgi_app(application)
if __name__ == "__main__":
main()