Esempio n. 1
0
 def store():
     stop = Stop.get(key)
     stop.confirm = 'NO'
     # remove updated data set
     old_stop = Stop.all().ancestor(counter).filter("osm_id =", stop.osm_id).filter('confirm =', 'NO').get()
     assert old_stop, "Did not find original data for update"
     counter.counter_delta(-1, stop.stop_type, "UPDATE")
     counter.put()
     stop.put()
     old_stop.delete()
Esempio n. 2
0
    def get(self, login_user=None, template_values={}):

        obsolete = [key for key in self.request.get_all("obsolete_key", None)]
        logging.debug(obsolete)

        key = self.request.get("accept", None)
        assert key, "Did not receive key"

        new_stop = Stop.get(key)
        new_stop.confirm = "NO"

        counter = StopMeta.all().get()
        def store():
            for key in obsolete:
                stop = Stop.all().ancestor(counter).filter("__key__ =", Key(key)).get()
                counter.counter_delta(-1, stop.stop_type)
            counter.counter_delta(1, stop.stop_type)
            counter.counter_delta(-1, stop.stop_type, "NEW")
            db.put(new_stop)
            db.delete(obsolete)
            counter.put()
        db.run_in_transaction(store)

        self.redirect('/update/confirm/new')
Esempio n. 3
0
 def store():
     stop = Stop.get(key)
     counter.counter_delta(-1, stop.stop_type, "UPDATE")
     counter.put()
     stop.delete()