-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.py
47 lines (37 loc) · 964 Bytes
/
init.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
from datetime import datetime
import webapp2
from models.classes import *
INIT_GROUP_ADMIN = 'admin'
INIT_GROUP_USER = 'user'
INIT_GROUP_PENDING = 'pending'
INIT_GROUP_ANONYMOUS = 'anonymous'
INIT_EXTRA_LAST_INIT = 'last_init'
class MainPage(webapp2.RequestHandler):
def get(self):
Group(
id=INIT_GROUP_ANONYMOUS,
book_view=True
).put()
Group(
id=INIT_GROUP_ADMIN,
book_view=True,
book_edit=True,
book_borrow=True
).put()
Group(
id=INIT_GROUP_PENDING,
book_view=True
).put()
Group(
id=INIT_GROUP_USER,
book_view=True,
book_borrow=True
).put()
Extra(
id=INIT_EXTRA_LAST_INIT,
value=str(datetime.now())
).put()
self.response.write('complete.')
APPLICATION = webapp2.WSGIApplication([
('.*', MainPage)
])