def get(self): notes = Notes.all() logout = None login = None currentuser = users.get_current_user() if currentuser: logout = users.create_logout_url('/notes/create' ) else: login = users.create_login_url('/notes/create') self.render_template('index.html', {'notes': notes,'currentuser':currentuser, 'login':login, 'logout': logout})
def post(self): validation = "false" username = self.request.get('inputUsername') password = self.request.get('inputPassword') notes = Notes.all() for note in notes: if note.text == username: if note.priority == password: return webapp2.redirect('/first/' + note.text) return webapp2.redirect('/login')
def get(self): user = users.get_current_user() logging.info('************ ' + user.nickname() + ' on MainPage *******') if user: notes = Notes.all().filter('owner = ', user).order('priority').order('date') nickname = user.nickname() users.create_logout_url('/') self.render_template('index.html', {'notes': notes,'user':user,'nickname':nickname},) else: self.redirect(users.create_login_url(self.request.uri))
def get(self): user = users.get_current_user() if user: notes = Notes.all().filter("id =", user.user_id()) if decorator.has_credentials(): try: http = decorator.http() gplus = service.people().get(userId='me').execute(http=http) self.render_template('index.html', {'notes': notes, 'gplus': gplus, 'users': users}) except client.AccessTokenRefreshError: self.redirect('/') else: self.redirect(decorator.authorize_url()) else: self.redirect(users.create_login_url(self.request.uri))
def get(self, id): username = id notes = Notes.all() for note in notes: if note.text == username: self.render_template('first.html', {'note': note})
def get(self): notes = Notes.all() self.render_template('users_index.html', {'notes': notes})
def get(self): user = users.get_current_user() notes = Notes.all().filter("author =", user.user_id()) self.render_template('home.html', {'notes': notes, 'users': users})
def get(self): notes = Notes.all() self.render_template('index.html', {'notes': notes, 'users': users})