From afd3ad005bbd2c340a042610bdec013c83f729d3 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 7 Jun 2015 10:03:52 +0200 Subject: [PATCH] Rename model into models to be compliant with views name. --- accountant/__init__.py | 1 + accountant/api/{model => models}/__init__.py | 0 accountant/api/{model => models}/accounts.py | 0 accountant/api/{model => models}/entries.py | 0 accountant/api/{model => models}/operations.py | 0 accountant/api/{model => models}/scheduled_operations.py | 0 accountant/api/views/accounts.py | 6 +++--- accountant/api/views/entries.py | 4 ++-- accountant/api/views/scheduled_operations.py | 3 ++- 9 files changed, 8 insertions(+), 6 deletions(-) rename accountant/api/{model => models}/__init__.py (100%) rename accountant/api/{model => models}/accounts.py (100%) rename accountant/api/{model => models}/entries.py (100%) rename accountant/api/{model => models}/operations.py (100%) rename accountant/api/{model => models}/scheduled_operations.py (100%) diff --git a/accountant/__init__.py b/accountant/__init__.py index 6b5eefb..8224fc0 100644 --- a/accountant/__init__.py +++ b/accountant/__init__.py @@ -31,6 +31,7 @@ app.config['SECRET_KEY'] = 'my_secret_key' db = SQLAlchemy(app) + @contextmanager def session_scope(): from accountant import db diff --git a/accountant/api/model/__init__.py b/accountant/api/models/__init__.py similarity index 100% rename from accountant/api/model/__init__.py rename to accountant/api/models/__init__.py diff --git a/accountant/api/model/accounts.py b/accountant/api/models/accounts.py similarity index 100% rename from accountant/api/model/accounts.py rename to accountant/api/models/accounts.py diff --git a/accountant/api/model/entries.py b/accountant/api/models/entries.py similarity index 100% rename from accountant/api/model/entries.py rename to accountant/api/models/entries.py diff --git a/accountant/api/model/operations.py b/accountant/api/models/operations.py similarity index 100% rename from accountant/api/model/operations.py rename to accountant/api/models/operations.py diff --git a/accountant/api/model/scheduled_operations.py b/accountant/api/models/scheduled_operations.py similarity index 100% rename from accountant/api/model/scheduled_operations.py rename to accountant/api/models/scheduled_operations.py diff --git a/accountant/api/views/accounts.py b/accountant/api/views/accounts.py index 46dde6f..da53f6a 100644 --- a/accountant/api/views/accounts.py +++ b/accountant/api/views/accounts.py @@ -23,9 +23,9 @@ from accountant import session_scope from . import auth from .. import api -from ..model.accounts import Account -from ..model.entries import Entry -from ..model.operations import Operation +from ..models.accounts import Account +from ..models.entries import Entry +from ..models.operations import Operation @api.route("/accounts", methods=["GET"]) diff --git a/accountant/api/views/entries.py b/accountant/api/views/entries.py index 994a793..f70a7da 100644 --- a/accountant/api/views/entries.py +++ b/accountant/api/views/entries.py @@ -20,8 +20,8 @@ from accountant import session_scope from .. import api -from ..model.entries import Entry -from ..model.operations import Operation +from ..models.entries import Entry +from ..models.operations import Operation @api.route("/entries///") diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py index 26bde80..4538648 100644 --- a/accountant/api/views/scheduled_operations.py +++ b/accountant/api/views/scheduled_operations.py @@ -18,8 +18,9 @@ from flask import json, request from accountant import session_scope +from ..models.scheduled_operations import ScheduledOperation + from .. import api -from ..model.scheduled_operations import ScheduledOperation @api.route("/scheduled_operations/")