From bfce747ba1eff95124b29a325b5cd867280ab6f4 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 20 Apr 2016 12:56:59 +0200 Subject: [PATCH] make it compatible with python 3.4 --- api/helpers/__init__.py | 2 +- api/models/__init__.py | 2 +- api/views/designers.py | 2 +- manage.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/helpers/__init__.py b/api/helpers/__init__.py index a3edbf2..6545dd6 100644 --- a/api/helpers/__init__.py +++ b/api/helpers/__init__.py @@ -1 +1 @@ -from json import JSONEncoder, JsonSerializer \ No newline at end of file +from .json import JSONEncoder, JsonSerializer \ No newline at end of file diff --git a/api/models/__init__.py b/api/models/__init__.py index ed340fe..0053335 100644 --- a/api/models/__init__.py +++ b/api/models/__init__.py @@ -1 +1 @@ -from designer import Designer \ No newline at end of file +from .designer import Designer \ No newline at end of file diff --git a/api/views/designers.py b/api/views/designers.py index dc7febb..a1d3e2d 100644 --- a/api/views/designers.py +++ b/api/views/designers.py @@ -27,7 +27,7 @@ def show(id): def update(id): designer = Designer.query.get_or_404(id) data = request.json - for k, v in data.iteritems(): + for k, v in data.items(): setattr(designer, k, v) db.session.add(designer) db.session.commit() diff --git a/manage.py b/manage.py index 3d1cb74..43bac59 100644 --- a/manage.py +++ b/manage.py @@ -7,17 +7,17 @@ manager = Manager(app) @manager.command def initdb(): db.create_all() - print 'All tables created' + print("All tables created") @manager.command def dropdb(): if prompt_bool("Are you sure you want to lose all your data"): db.drop_all() - print 'All tables dropped' + print("All tables dropped") @manager.command def seed(): - print 'Adding sample data %s' % db.engine.url + print("Adding sample data") designer = Designer(name="Martin", path='/martin') db.session.add(designer) db.session.commit()