Merge branch 'master' of github.com:openeventdatabase/backend

This commit is contained in:
Christian Quest 2016-05-09 14:13:59 +02:00
commit 5d07c7895d
2 changed files with 14 additions and 1 deletions

View file

@ -1,4 +1,4 @@
FROM ubuntu:15.10
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y postgresql-server-dev-all
RUN apt-get install -y python3-dev

View file

@ -186,6 +186,19 @@ WHERE events_id=%s;""", (id,))
def on_put(self, req, resp, id):
self.insert_or_update(req, resp, id, """UPDATE events SET ( events_type, events_what, events_when, events_tags, events_geo) = (%s, %s, tstzrange(%s,%s,%s) , %s, %s) WHERE events_id = %s RETURNING events_id;""")
def on_delete(self, req, resp, id):
standard_headers(resp)
db = db_connect()
cur = db.cursor()
cur.execute("""DELETE FROM events WHERE events_id = %s;""",(id,));
db.commit()
cur.close()
db.close()
if cur.rowcount:
resp.status = falcon.HTTP_204
else:
resp.status = falcon.HTTP_404
# falcon.API instances are callable WSGI apps
app = falcon.API()