Esempio n. 1
0
    def post(self):

        t = self.request.get('text')
        t = url_regex.sub(process_match, t)
        n = StickyNote(author=users.get_current_user().nickname(),
                       text=t,
                       status=self.request.get('status'))
        n.put()
        return webapp2.redirect('/notes')
Esempio n. 2
0
 def get(self):
     flag = True
     # Get only yours buddy
     notes = StickyNote.all()
     template_values = createTemplate(self)
     notes = notes.filter('author = ', template_values['user'])
     template_values['notes'] = notes
     template_values['flag'] = flag
     
     self.render_template('create.html', template_values)
Esempio n. 3
0
    def get(self, note_id):
        iden = int(note_id)
        note = db.get(db.Key.from_path('StickyNote', iden))
        # strip the note off of html tags and send it to edit
        note.text = delinkify(note.text)
        notes = StickyNote.all()
        notes = notes.filter('author = ', users.get_current_user().nickname())

        template_values = createTemplate(self)
        template_values['note'] =  note
        template_values['notes'] = notes
        self.render_template('edit.html', template_values)
Esempio n. 4
0
 def get(self):
     notes = StickyNote.all()
     template_values = createTemplate(self)
     notes = notes.filter('author = ', template_values['user'])
     template_values['notes'] = notes
     self.render_template('notes.html', template_values)