Пример #1
0
 def get(self, ident):
   source = Page.fetch_by_key(ident)
   source.key.delete()
   subject = 'Deleted {page} from datastore'.format(page=source.name)
   html_message = self.render_template('delete_email.html', write=False, item=source)
   send_mail(subject, html=html_message)
   self.response.write(html_message)
Пример #2
0
  def post(self, ident=None):
    if ident:
      source = Page.fetch_by_key(ident)
    else:
      source = Page()

    source.name = self.request.get('name', '')
    source.url = self.request.get('url', '')
    source.phrases = self.request.get('phrases', '')
    key = source.put()
    self.response.write(key.urlsafe())