summaryrefslogtreecommitdiff
path: root/meetingtools/utils.py
blob: 767da4322bf8cdc92ad20cb9fc982e7d86e63d01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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,path="/"):
    return "%s://%s%s" % ({True: 'https',False:'http'}[request.is_secure()],request.get_host(),path)