Exemplo n.º 1
0
 def post(self):
     slug = self.request.get('slug')
     if slug:
         article = get_article(slug)[0]  # returns a tuple of posts, cache_time
         if article:
             ndb.delete(article)
             memcache.flush_all()
             self.render('articles/_deleted.html')  # A html fragment returned via ajax
 def _batch_write(self):
     """Writes updates and deletes entities in a batch."""
     if self.to_put:
         ndb.put(self.to_put)
         self.to_put = []
     if self.to_delete:
         ndb.delete(self.to_delete)
         self.to_delete = []
Exemplo n.º 3
0
    def post(self):

        logging.error(self.request.arguments())


        genres=[]
        names=[]

        
        for i in self.request.arguments():
            genre=list(ndb.gql("select * from Genres where genre='%s'"%i))
            for i in genre:
                ndb.delete(i.key())
        self.redirect('/Blacklist')
Exemplo n.º 4
0
def remove_all():
    ndb.delete(UniverseText.all())
    ndb.delete(UniverseBin.all())
    return 'success'
Exemplo n.º 5
0
def delete(key):
    ndb.delete(key)
Exemplo n.º 6
0
def dbSafeDelete(key):
  if db.get(key) :  db.delete(key)
Exemplo n.º 7
0
def dbSafeDelete(key):
    if db.get(key): db.delete(key)