def getColorsAvailable(): colors = []; response.content_type = 'application/json'; colors = db.getColorsAvailable(); #print colors; return json.dumps(colors);
def createNoteForm(): sessionUser = checkCookiesSessionUser(); if (sessionUser == None): return redirectLogin(); note = {} # Empty dictionary. Because template for createNote is used also by Edit Note colors = db.getColorsAvailable(); # Get colors on our database. return template('createNote', note=note, colors=colors, editNote=False, user=sessionUser)
def displayNoteToBeupdated(Username, Permalink): sessionUser = checkCookiesSessionUser(); if sessionUser == None: return template('login', user=sessionUser) note = db.getNoteby_Username_Permalink(Username, Permalink); if note == None: return redirectHome(); if sessionUser['UserID'] == note['UserID']: colors = db.getColorsAvailable(); # get all the available colors return template('createNote', note=note, colors=colors,user=sessionUser, editNote=True) return redirectPrivateZone(); # Private note. Guest can't read this note