Пример #1
0
 def post(self):
     '''create new note no parent not in folder'''
     if ('title' not in self.json or 'content' not in self.json):
         self.error(400)
         return
     title = self.json['title']
     content = self.json['content']
     note = Note.create_new(self.user, title, content)
     self.response.set_status(201)
     self.response.headers['Content-type'] = 'application/json'
     self.response.out.write(note.to_json(True))
Пример #2
0
 def post(self):
     '''create new note no parent not in folder'''
     if ('title' not in self.json or 'content' not in self.json):
         self.error(400)
         return
     title = self.json['title']
     content = self.json['content']
     note = Note.create_new(self.user, title, content)
     self.response.set_status(201)
     self.response.headers['Content-type'] = 'application/json'
     self.response.out.write(note.to_json(True))