-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurrent_session.py
More file actions
50 lines (33 loc) · 980 Bytes
/
current_session.py
File metadata and controls
50 lines (33 loc) · 980 Bytes
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
48
49
50
from appengine_utilities.sessions import Session
from models.users import User
session_key = "current_user"
def current_user():
session = Session()
if session.has_key(session_key):
return session[session_key]
else:
return None
def registration_code():
session = Session()
if session.has_key("registration_code"):
return session["registration_code"]
else:
return None
def delete_session():
session = Session()
session.delete()
def set_current_user(user):
session = Session()
session[session_key] = user
def set_registration_code(code):
session = Session()
session["registration_code"] = code
def words_iter():
session = Session()
if session.has_key("words_iter"):
return session["words_iter"]
else:
return None
def set_words_iter(words_iter):
session = Session()
session["words_iter"] = words_iter