diff options
Diffstat (limited to 'meetingtools/utils.py')
-rw-r--r-- | meetingtools/utils.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/meetingtools/utils.py b/meetingtools/utils.py new file mode 100644 index 0000000..eee0d80 --- /dev/null +++ b/meetingtools/utils.py @@ -0,0 +1,20 @@ +''' +Created on Feb 4, 2011 + +@author: leifj +''' + +def session(request,key=None,val=None): + if key: + if val: + request.session[key] = val + return val + else: + if not request.session.has_key(key): + request.session[key] = None + return request.session[key] + else: + return request.session + +def base_url(request): + return "%s://%s/" % ({True: 'https',False:'http'}[request.is_secure()],request.get_host())
\ No newline at end of file |