From 32935f5159399e701f744db249d4e9127b1a059a Mon Sep 17 00:00:00 2001 From: Jan-Frederik Schmidt Date: Sun, 9 Jun 2024 13:59:37 +0200 Subject: [PATCH] chore: Rename module from `shopdb` to `shop_db2` --- .cruft.json | 6 ++-- .gitignore | 12 +++---- LICENSE.txt | 21 +++++++++++ Manager.py | 2 +- configuration.example.py | 4 +-- dev/__init__.py | 4 +-- pyproject.toml | 6 ++-- setup.cfg | 4 +-- setupdb.py | 8 ++--- shopdb_entry.py | 2 +- src/{shopdb => shop_db2}/__init__.py | 2 +- src/{shopdb => shop_db2}/api.py | 34 +++++++++--------- src/{shopdb => shop_db2}/exceptions.py | 0 src/{shopdb => shop_db2}/helpers/__init__.py | 0 .../helpers/decorators.py | 6 ++-- src/{shopdb => shop_db2}/helpers/deposits.py | 8 ++--- src/{shopdb => shop_db2}/helpers/errors.py | 4 +-- src/{shopdb => shop_db2}/helpers/hooks.py | 6 ++-- src/{shopdb => shop_db2}/helpers/products.py | 10 +++--- src/{shopdb => shop_db2}/helpers/purchases.py | 10 +++--- src/{shopdb => shop_db2}/helpers/query.py | 4 +-- .../helpers/replenishments.py | 4 +-- .../helpers/stocktakings.py | 13 +++++-- src/{shopdb => shop_db2}/helpers/updater.py | 8 ++--- src/{shopdb => shop_db2}/helpers/uploads.py | 2 +- src/{shopdb => shop_db2}/helpers/users.py | 8 ++--- src/{shopdb => shop_db2}/helpers/utils.py | 2 +- .../helpers/validators.py | 2 +- src/{shopdb => shop_db2}/models/__init__.py | 0 .../models/admin_update.py | 4 +-- src/{shopdb => shop_db2}/models/deposit.py | 2 +- src/{shopdb => shop_db2}/models/product.py | 6 ++-- .../models/product_price.py | 4 +-- .../models/product_tag_assignment.py | 2 +- src/{shopdb => shop_db2}/models/purchase.py | 4 +-- src/{shopdb => shop_db2}/models/rank.py | 2 +- .../models/rank_update.py | 4 +-- .../models/replenishment.py | 6 ++-- src/{shopdb => shop_db2}/models/revoke.py | 4 +-- .../models/stocktaking.py | 4 +-- src/{shopdb => shop_db2}/models/tag.py | 2 +- src/{shopdb => shop_db2}/models/upload.py | 2 +- src/{shopdb => shop_db2}/models/user.py | 6 ++-- .../models/user_verification.py | 4 +-- src/{shopdb => shop_db2}/py.typed | 0 src/{shopdb => shop_db2}/routes/__init__.py | 0 src/{shopdb => shop_db2}/routes/backups.py | 4 +-- src/{shopdb => shop_db2}/routes/deposits.py | 18 +++++----- .../routes/financial_overview.py | 8 ++--- src/{shopdb => shop_db2}/routes/images.py | 4 +-- src/{shopdb => shop_db2}/routes/login.py | 10 +++--- .../routes/maintenance.py | 10 +++--- src/{shopdb => shop_db2}/routes/products.py | 18 +++++----- src/{shopdb => shop_db2}/routes/purchases.py | 16 ++++----- src/{shopdb => shop_db2}/routes/ranks.py | 16 ++++----- .../routes/replenishmentcollections.py | 16 ++++----- .../routes/stocktakingcollections.py | 20 +++++------ .../routes/tagassignments.py | 12 +++---- src/{shopdb => shop_db2}/routes/tags.py | 16 ++++----- src/{shopdb => shop_db2}/routes/users.py | 16 ++++----- src/{shopdb => shop_db2}/shared/__init__.py | 0 .../stocktakingcollections_template.html | 0 .../uploads/broken_image.jpeg | Bin .../uploads/broken_image.jpg | Bin .../uploads/broken_image.png | Bin src/{shopdb => shop_db2}/uploads/default.png | Bin .../uploads/non_quadratic.png | Bin .../uploads/valid_image.jpeg | Bin .../uploads/valid_image.jpg | Bin .../uploads/valid_image.png | Bin tests/base.py | 4 +-- tests/test_default_data.py | 4 +-- .../unit/api/test_api_change_tagassignment.py | 10 +++--- .../unit/api/test_api_create_batch_deposit.py | 6 ++-- tests/unit/api/test_api_create_deposit.py | 6 ++-- tests/unit/api/test_api_create_product.py | 6 ++-- tests/unit/api/test_api_create_purchase.py | 6 ++-- tests/unit/api/test_api_create_rank.py | 6 ++-- .../test_api_create_replenismentcollection.py | 6 ++-- .../test_api_create_stocktakingcollection.py | 6 ++-- tests/unit/api/test_api_create_tag.py | 6 ++-- tests/unit/api/test_api_create_user.py | 4 +-- tests/unit/api/test_api_delete_tag.py | 6 ++-- tests/unit/api/test_api_delete_user.py | 4 +-- ...st_api_get_balance_between_stocktakings.py | 2 +- tests/unit/api/test_api_get_deposit.py | 6 ++-- .../api/test_api_get_financial_overview.py | 6 ++-- tests/unit/api/test_api_get_image.py | 4 +-- tests/unit/api/test_api_get_product.py | 6 ++-- .../api/test_api_get_product_pricehistory.py | 6 ++-- tests/unit/api/test_api_get_purchase.py | 2 +- tests/unit/api/test_api_get_rank.py | 2 +- .../api/test_api_get_replenismencollection.py | 2 +- ...test_api_get_stocktaking_print_template.py | 6 ++-- .../api/test_api_get_stocktakingcollection.py | 2 +- tests/unit/api/test_api_get_tag.py | 2 +- tests/unit/api/test_api_get_user.py | 6 ++-- tests/unit/api/test_api_get_user_deposits.py | 6 ++-- tests/unit/api/test_api_get_user_favorites.py | 6 ++-- tests/unit/api/test_api_get_user_purchases.py | 6 ++-- tests/unit/api/test_api_list_backups.py | 2 +- tests/unit/api/test_api_list_deposits.py | 2 +- tests/unit/api/test_api_list_products.py | 4 +-- tests/unit/api/test_api_list_purchases.py | 6 ++-- .../test_api_list_replenishmentcollections.py | 2 +- .../test_api_list_stocktakingcollections.py | 2 +- tests/unit/api/test_api_list_users.py | 4 +-- tests/unit/api/test_api_login.py | 6 ++-- tests/unit/api/test_api_misc.py | 6 ++-- tests/unit/api/test_api_query_parameters.py | 2 +- tests/unit/api/test_api_toggle_maintenance.py | 4 +-- tests/unit/api/test_api_token.py | 2 +- tests/unit/api/test_api_update_deposit.py | 4 +-- tests/unit/api/test_api_update_product.py | 6 ++-- tests/unit/api/test_api_update_purchase.py | 6 ++-- tests/unit/api/test_api_update_rank.py | 4 +-- .../unit/api/test_api_update_replenishment.py | 4 +-- ...test_api_update_replenishmentcollection.py | 4 +-- tests/unit/api/test_api_update_stocktaking.py | 4 +-- .../test_api_update_stocktakingcollection.py | 4 +-- tests/unit/api/test_api_update_tag.py | 4 +-- tests/unit/api/test_api_update_user.py | 6 ++-- tests/unit/helpers/test_helpers_products.py | 8 ++--- tests/unit/helpers/test_helpers_purchases.py | 6 ++-- .../unit/helpers/test_helpers_stocktakings.py | 6 ++-- tests/unit/models/test_model_deposit.py | 4 +-- tests/unit/models/test_model_purchase.py | 4 +-- tests/unit/models/test_model_tag.py | 4 +-- tests/unit/models/test_model_user.py | 6 ++-- tests/unit/test_app_functions.py | 6 ++-- wsgi.py | 2 +- 131 files changed, 372 insertions(+), 344 deletions(-) rename src/{shopdb => shop_db2}/__init__.py (97%) rename src/{shopdb => shop_db2}/api.py (72%) rename src/{shopdb => shop_db2}/exceptions.py (100%) rename src/{shopdb => shop_db2}/helpers/__init__.py (100%) rename src/{shopdb => shop_db2}/helpers/decorators.py (98%) rename src/{shopdb => shop_db2}/helpers/deposits.py (89%) rename src/{shopdb => shop_db2}/helpers/errors.py (96%) rename src/{shopdb => shop_db2}/helpers/hooks.py (94%) rename src/{shopdb => shop_db2}/helpers/products.py (95%) rename src/{shopdb => shop_db2}/helpers/purchases.py (92%) rename src/{shopdb => shop_db2}/helpers/query.py (99%) rename src/{shopdb => shop_db2}/helpers/replenishments.py (89%) rename src/{shopdb => shop_db2}/helpers/stocktakings.py (95%) rename src/{shopdb => shop_db2}/helpers/updater.py (96%) rename src/{shopdb => shop_db2}/helpers/uploads.py (98%) rename src/{shopdb => shop_db2}/helpers/users.py (90%) rename src/{shopdb => shop_db2}/helpers/utils.py (98%) rename src/{shopdb => shop_db2}/helpers/validators.py (98%) rename src/{shopdb => shop_db2}/models/__init__.py (100%) rename src/{shopdb => shop_db2}/models/admin_update.py (92%) rename src/{shopdb => shop_db2}/models/deposit.py (98%) rename src/{shopdb => shop_db2}/models/product.py (98%) rename src/{shopdb => shop_db2}/models/product_price.py (90%) rename src/{shopdb => shop_db2}/models/product_tag_assignment.py (89%) rename src/{shopdb => shop_db2}/models/purchase.py (96%) rename src/{shopdb => shop_db2}/models/rank.py (94%) rename src/{shopdb => shop_db2}/models/rank_update.py (91%) rename src/{shopdb => shop_db2}/models/replenishment.py (97%) rename src/{shopdb => shop_db2}/models/revoke.py (92%) rename src/{shopdb => shop_db2}/models/stocktaking.py (96%) rename src/{shopdb => shop_db2}/models/tag.py (94%) rename src/{shopdb => shop_db2}/models/upload.py (93%) rename src/{shopdb => shop_db2}/models/user.py (98%) rename src/{shopdb => shop_db2}/models/user_verification.py (90%) rename src/{shopdb => shop_db2}/py.typed (100%) rename src/{shopdb => shop_db2}/routes/__init__.py (100%) rename src/{shopdb => shop_db2}/routes/backups.py (95%) rename src/{shopdb => shop_db2}/routes/deposits.py (90%) rename src/{shopdb => shop_db2}/routes/financial_overview.py (93%) rename src/{shopdb => shop_db2}/routes/images.py (93%) rename src/{shopdb => shop_db2}/routes/login.py (90%) rename src/{shopdb => shop_db2}/routes/maintenance.py (91%) rename src/{shopdb => shop_db2}/routes/products.py (94%) rename src/{shopdb => shop_db2}/routes/purchases.py (90%) rename src/{shopdb => shop_db2}/routes/ranks.py (87%) rename src/{shopdb => shop_db2}/routes/replenishmentcollections.py (93%) rename src/{shopdb => shop_db2}/routes/stocktakingcollections.py (94%) rename src/{shopdb => shop_db2}/routes/tagassignments.py (89%) rename src/{shopdb => shop_db2}/routes/tags.py (91%) rename src/{shopdb => shop_db2}/routes/users.py (95%) rename src/{shopdb => shop_db2}/shared/__init__.py (100%) rename src/{shopdb => shop_db2}/templates/stocktakingcollections_template.html (100%) rename src/{shopdb => shop_db2}/uploads/broken_image.jpeg (100%) rename src/{shopdb => shop_db2}/uploads/broken_image.jpg (100%) rename src/{shopdb => shop_db2}/uploads/broken_image.png (100%) rename src/{shopdb => shop_db2}/uploads/default.png (100%) rename src/{shopdb => shop_db2}/uploads/non_quadratic.png (100%) rename src/{shopdb => shop_db2}/uploads/valid_image.jpeg (100%) rename src/{shopdb => shop_db2}/uploads/valid_image.jpg (100%) rename src/{shopdb => shop_db2}/uploads/valid_image.png (100%) diff --git a/.cruft.json b/.cruft.json index b9869a7..f9f1e2b 100644 --- a/.cruft.json +++ b/.cruft.json @@ -9,10 +9,10 @@ "github_user": "", "project_name": "shop-db2", "repo_name": "shop-db2", - "package_name": "shopdb", - "import_name": "shopdb", + "package_name": "shop-db2", + "import_name": "shop_db2", "project_short_description": "The simple way to manage purchases and user interactions in a small community.", - "url": "https://github.com/g3n35i5/shopdb", + "url": "https://github.com/g3n35i5/shop-db2", "_debug": "False", "_extensions": ["extensions.git_extension.GitExtension"], "_copy_without_render": ["docs/_templates/license_compliance.rst.j2"], diff --git a/.gitignore b/.gitignore index 9a42ddb..93de646 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,10 @@ configuration.py coverage.xml .codacy-coverage codacy-coverage.json -shopdb/uploads/* -!shopdb/uploads/valid* -!shopdb/uploads/broken* -!shopdb/uploads/non_quadratic.png +src/shop_db2/uploads/* +!src/shop_db2/uploads/valid* +!src/shop_db2/uploads/broken* +!src/shop_db2/uploads/non_quadratic.png # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -128,7 +128,7 @@ reports/ .coverage .coverage.* MANIFEST -docs/shopdb* +docs/shop-db2* docs/modules.rst docs/ossLicenses.json docs/license_compliance.rst @@ -143,7 +143,7 @@ dist/ *.class *.py[cod] *.jar -shopdb-[0-9]* +shop-db2-[0-9]* # Log files **/log/**/* diff --git a/LICENSE.txt b/LICENSE.txt index e69de29..c1b4496 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Jan-Frederik Schmidt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Manager.py b/Manager.py index 51bcd0e..731fb89 100755 --- a/Manager.py +++ b/Manager.py @@ -6,7 +6,7 @@ from flask_script import Manager import configuration as config -from shopdb.api import app, db, set_app +from shop_db2.api import app, db, set_app set_app(config.ProductiveConfig) migrate = Migrate(app, db) diff --git a/configuration.example.py b/configuration.example.py index 8a58b42..dd6a95c 100644 --- a/configuration.example.py +++ b/configuration.example.py @@ -11,7 +11,7 @@ class BaseConfig(object): HOST = "127.0.0.1" PORT = 5000 SQLALCHEMY_TRACK_MODIFICATIONS = False - UPLOAD_FOLDER = PATH + "/src/shopdb/uploads/" + UPLOAD_FOLDER = PATH + "/src/shop_db2/uploads/" MAX_CONTENT_LENGTH = 4 * 1024 * 1024 VALID_EXTENSIONS = ["png"] MINIMUM_PASSWORD_LENGTH = 6 @@ -22,7 +22,7 @@ class ProductiveConfig(BaseConfig): DEBUG = False TEST = False ENV = "productive" - DATABASE_PATH = PATH + "/src/shopdb/shop.db" + DATABASE_PATH = PATH + "/src/shop_db2/shop.db" SQLALCHEMY_DATABASE_URI = "sqlite:///" + DATABASE_PATH diff --git a/dev/__init__.py b/dev/__init__.py index bc77695..017267b 100644 --- a/dev/__init__.py +++ b/dev/__init__.py @@ -1,5 +1,5 @@ -from shopdb.api import bcrypt -from shopdb.models import * +from shop_db2.api import bcrypt +from shop_db2.models import * PASSWORD = bcrypt.generate_password_hash("1234") diff --git a/pyproject.toml b/pyproject.toml index e23994a..395aa15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ ignore-signatures = "yes" disallow_untyped_defs = true warn_unused_ignores = true exclude = [ - "shopdb-\\d+", # Ignore temporary folder created by setuptools when building an sdist + "shop-db2-\\d+", # Ignore temporary folder created by setuptools when building an sdist "venv.*/", "log/", "build/", @@ -91,11 +91,11 @@ addopts = """ -vv --doctest-modules --import-mode=append - --ignore-glob=shopdb-[0-9]* + --ignore-glob=shop-db2-[0-9]* --ignore="migrations" --ignore="configuration.example.py" --ignore="docs/_scripts" - --cov=shopdb + --cov=shop-db2 --cov-config=pyproject.toml --cov-report= """ diff --git a/setup.cfg b/setup.cfg index 09a6d09..3c9dfa5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = shopdb +name = shop-db2 author = Jan-Frederik Schmidt author_email = janfschmidt@mailbox.org description = The simple way to manage purchases and user interactions in a small community. @@ -46,7 +46,7 @@ where = src [options.package_data] * = py.typed -shopdb = +shop_db2 = uploads/** templates/** diff --git a/setupdb.py b/setupdb.py index 0367af2..5be5881 100644 --- a/setupdb.py +++ b/setupdb.py @@ -10,10 +10,10 @@ from sqlalchemy.exc import IntegrityError import configuration as config -import shopdb.exceptions as exc -from shopdb.api import app, db, set_app -from shopdb.helpers.users import insert_user -from shopdb.models import Rank, User +import shop_db2.exceptions as exc +from shop_db2.api import app, db, set_app +from shop_db2.helpers.users import insert_user +from shop_db2.models import Rank, User def _get_password(): diff --git a/shopdb_entry.py b/shopdb_entry.py index 1488a93..9aa443f 100755 --- a/shopdb_entry.py +++ b/shopdb_entry.py @@ -18,7 +18,7 @@ from flask_cors import CORS from dev import insert_dev_data -from shopdb.api import app, db, set_app +from shop_db2.api import app, db, set_app if __name__ == "__main__": parser = argparse.ArgumentParser(description="Starting script shop.db") diff --git a/src/shopdb/__init__.py b/src/shop_db2/__init__.py similarity index 97% rename from src/shopdb/__init__.py rename to src/shop_db2/__init__.py index b3ba2d1..0660b39 100644 --- a/src/shopdb/__init__.py +++ b/src/shop_db2/__init__.py @@ -3,7 +3,7 @@ from importlib_metadata import PackageNotFoundError as _PackageNotFoundError from importlib_metadata import version as _version -__module_name__ = "shopdb" +__module_name__ = "shop_db2" try: # pragma: no cover __version__ = _version(__module_name__) diff --git a/src/shopdb/api.py b/src/shop_db2/api.py similarity index 72% rename from src/shopdb/api.py rename to src/shop_db2/api.py index ac5b7d0..af2b3e7 100644 --- a/src/shopdb/api.py +++ b/src/shop_db2/api.py @@ -6,7 +6,7 @@ from flask_bcrypt import Bcrypt import configuration as config -from shopdb.shared import db +from shop_db2.shared import db app = Flask(__name__) @@ -45,64 +45,64 @@ def index(): # Error handler # noinspection PyUnresolvedReferences -import shopdb.helpers.errors # noqa: E402 +import shop_db2.helpers.errors # noqa: E402 # App hooks # noinspection PyUnresolvedReferences -import shopdb.helpers.hooks # noqa: E402 +import shop_db2.helpers.hooks # noqa: E402 # Backup routes # noinspection PyUnresolvedReferences -import shopdb.routes.backups # noqa: E402 +import shop_db2.routes.backups # noqa: E402 # Deposit routes # noinspection PyUnresolvedReferences -import shopdb.routes.deposits # noqa: E402 +import shop_db2.routes.deposits # noqa: E402 # Financial overview route # noinspection PyUnresolvedReferences -import shopdb.routes.financial_overview # noqa: E402 +import shop_db2.routes.financial_overview # noqa: E402 # Image routes # noinspection PyUnresolvedReferences -import shopdb.routes.images # noqa: E402 +import shop_db2.routes.images # noqa: E402 # Login route # noinspection PyUnresolvedReferences -import shopdb.routes.login # noqa: E402 +import shop_db2.routes.login # noqa: E402 # Maintenance routes # noinspection PyUnresolvedReferences -import shopdb.routes.maintenance # noqa: E402 +import shop_db2.routes.maintenance # noqa: E402 # Product routes # noinspection PyUnresolvedReferences -import shopdb.routes.products # noqa: E402 +import shop_db2.routes.products # noqa: E402 # Purchase routes # noinspection PyUnresolvedReferences -import shopdb.routes.purchases # noqa: E402 +import shop_db2.routes.purchases # noqa: E402 # Rank routes # noinspection PyUnresolvedReferences -import shopdb.routes.ranks # noqa: E402 +import shop_db2.routes.ranks # noqa: E402 # ReplenishmentCollection routes # noinspection PyUnresolvedReferences -import shopdb.routes.replenishmentcollections # noqa: E402 +import shop_db2.routes.replenishmentcollections # noqa: E402 # StocktakingCollection routes # noinspection PyUnresolvedReferences -import shopdb.routes.stocktakingcollections # noqa: E402 +import shop_db2.routes.stocktakingcollections # noqa: E402 # Tag assignment routes # noinspection PyUnresolvedReferences -import shopdb.routes.tagassignments # noqa: E402 +import shop_db2.routes.tagassignments # noqa: E402 # Tag routes # noinspection PyUnresolvedReferences -import shopdb.routes.tags # noqa: E402 +import shop_db2.routes.tags # noqa: E402 # User routes # noinspection PyUnresolvedReferences -import shopdb.routes.users # noqa: E402 +import shop_db2.routes.users # noqa: E402 diff --git a/src/shopdb/exceptions.py b/src/shop_db2/exceptions.py similarity index 100% rename from src/shopdb/exceptions.py rename to src/shop_db2/exceptions.py diff --git a/src/shopdb/helpers/__init__.py b/src/shop_db2/helpers/__init__.py similarity index 100% rename from src/shopdb/helpers/__init__.py rename to src/shop_db2/helpers/__init__.py diff --git a/src/shopdb/helpers/decorators.py b/src/shop_db2/helpers/decorators.py similarity index 98% rename from src/shopdb/helpers/decorators.py rename to src/shop_db2/helpers/decorators.py index ca50d02..44f39b9 100644 --- a/src/shopdb/helpers/decorators.py +++ b/src/shop_db2/helpers/decorators.py @@ -7,9 +7,9 @@ import jwt from flask import Response, request -import shopdb.exceptions as exc -from shopdb.api import app -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import app +from shop_db2.models import User def checkIfUserIsValid(f): diff --git a/src/shopdb/helpers/deposits.py b/src/shop_db2/helpers/deposits.py similarity index 89% rename from src/shopdb/helpers/deposits.py rename to src/shop_db2/helpers/deposits.py index 178dd00..d35dcf3 100644 --- a/src/shopdb/helpers/deposits.py +++ b/src/shop_db2/helpers/deposits.py @@ -4,10 +4,10 @@ from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Deposit, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Deposit, User def insert_deposit(data, admin): diff --git a/src/shopdb/helpers/errors.py b/src/shop_db2/helpers/errors.py similarity index 96% rename from src/shopdb/helpers/errors.py rename to src/shop_db2/helpers/errors.py index 3d68c5c..1227a7e 100644 --- a/src/shopdb/helpers/errors.py +++ b/src/shop_db2/helpers/errors.py @@ -5,8 +5,8 @@ import werkzeug.exceptions as werkzeug_exceptions from flask import jsonify -import shopdb.exceptions as exc -from shopdb.api import app, db +import shop_db2.exceptions as exc +from shop_db2.api import app, db @app.errorhandler(Exception) diff --git a/src/shopdb/helpers/hooks.py b/src/shop_db2/helpers/hooks.py similarity index 94% rename from src/shopdb/helpers/hooks.py rename to src/shop_db2/helpers/hooks.py index 753b1a3..cac60e9 100644 --- a/src/shopdb/helpers/hooks.py +++ b/src/shop_db2/helpers/hooks.py @@ -8,9 +8,9 @@ from flask import g, request -import shopdb.exceptions as exc -from shopdb.api import app -from shopdb.helpers.decorators import adminOptional +import shop_db2.exceptions as exc +from shop_db2.api import app +from shop_db2.helpers.decorators import adminOptional @app.before_request diff --git a/src/shopdb/helpers/products.py b/src/shop_db2/helpers/products.py similarity index 95% rename from src/shopdb/helpers/products.py rename to src/shop_db2/helpers/products.py index 40573bc..465c206 100644 --- a/src/shopdb/helpers/products.py +++ b/src/shop_db2/helpers/products.py @@ -5,11 +5,11 @@ from sqlalchemy import and_ -import shopdb.exceptions as exc -import shopdb.helpers.purchases as purchase_helpers -import shopdb.helpers.replenishments as replenishment_helpers -import shopdb.helpers.stocktakings as stocktaking_helpers -from shopdb.models import Product, ProductPrice +import shop_db2.exceptions as exc +import shop_db2.helpers.purchases as purchase_helpers +import shop_db2.helpers.replenishments as replenishment_helpers +import shop_db2.helpers.stocktakings as stocktaking_helpers +from shop_db2.models import Product, ProductPrice def _shift_date_to_begin_of_day(date): diff --git a/src/shopdb/helpers/purchases.py b/src/shop_db2/helpers/purchases.py similarity index 92% rename from src/shopdb/helpers/purchases.py rename to src/shop_db2/helpers/purchases.py index f5fa4b8..d4d4cc6 100644 --- a/src/shopdb/helpers/purchases.py +++ b/src/shop_db2/helpers/purchases.py @@ -8,11 +8,11 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.sql import func -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.helpers.utils import parse_timestamp -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Product, Purchase, Rank, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.helpers.utils import parse_timestamp +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Product, Purchase, Rank, User def get_purchase_amount_in_interval(product_id: int, start: datetime.datetime, end: datetime.datetime) -> int: diff --git a/src/shopdb/helpers/query.py b/src/shop_db2/helpers/query.py similarity index 99% rename from src/shopdb/helpers/query.py rename to src/shop_db2/helpers/query.py index 729546d..0fecd82 100644 --- a/src/shopdb/helpers/query.py +++ b/src/shop_db2/helpers/query.py @@ -10,8 +10,8 @@ from sqlalchemy.sql.expression import BinaryExpression from werkzeug import ImmutableMultiDict -import shopdb.exceptions as exc -from shopdb.api import db +import shop_db2.exceptions as exc +from shop_db2.api import db class QueryFromRequestParameters: diff --git a/src/shopdb/helpers/replenishments.py b/src/shop_db2/helpers/replenishments.py similarity index 89% rename from src/shopdb/helpers/replenishments.py rename to src/shop_db2/helpers/replenishments.py index c2ee8b9..4f1659e 100644 --- a/src/shopdb/helpers/replenishments.py +++ b/src/shop_db2/helpers/replenishments.py @@ -6,8 +6,8 @@ from sqlalchemy.sql import func -from shopdb.api import db -from shopdb.models import Replenishment, ReplenishmentCollection +from shop_db2.api import db +from shop_db2.models import Replenishment, ReplenishmentCollection def get_replenishment_amount_in_interval(product_id: int, start: datetime.datetime, end: datetime.datetime) -> int: diff --git a/src/shopdb/helpers/stocktakings.py b/src/shop_db2/helpers/stocktakings.py similarity index 95% rename from src/shopdb/helpers/stocktakings.py rename to src/shop_db2/helpers/stocktakings.py index 9811fbc..efcb698 100644 --- a/src/shopdb/helpers/stocktakings.py +++ b/src/shop_db2/helpers/stocktakings.py @@ -4,9 +4,16 @@ from sqlalchemy import and_, func -from shopdb.api import db -from shopdb.helpers.products import _get_product_mean_price_in_time_range -from shopdb.models import Product, Purchase, Replenishment, ReplenishmentCollection, Stocktaking, StocktakingCollection +from shop_db2.api import db +from shop_db2.helpers.products import _get_product_mean_price_in_time_range +from shop_db2.models import ( + Product, + Purchase, + Replenishment, + ReplenishmentCollection, + Stocktaking, + StocktakingCollection, +) def _get_balance_between_stocktakings(start, end): diff --git a/src/shopdb/helpers/updater.py b/src/shop_db2/helpers/updater.py similarity index 96% rename from src/shopdb/helpers/updater.py rename to src/shop_db2/helpers/updater.py index e9fb082..69887c3 100644 --- a/src/shopdb/helpers/updater.py +++ b/src/shop_db2/helpers/updater.py @@ -8,10 +8,10 @@ from flask import jsonify from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.helpers.validators import check_fields_and_types, check_forbidden -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.helpers.validators import check_fields_and_types, check_forbidden +from shop_db2.models import User def generic_update(model: db.Model, entry_id: int, data: dict, admin: Optional[User]): diff --git a/src/shopdb/helpers/uploads.py b/src/shop_db2/helpers/uploads.py similarity index 98% rename from src/shopdb/helpers/uploads.py rename to src/shop_db2/helpers/uploads.py index 42576b5..a724c18 100644 --- a/src/shopdb/helpers/uploads.py +++ b/src/shop_db2/helpers/uploads.py @@ -12,7 +12,7 @@ from PIL import Image import configuration as config -import shopdb.exceptions as exc +import shop_db2.exceptions as exc def insert_image(file: dict) -> str: diff --git a/src/shopdb/helpers/users.py b/src/shop_db2/helpers/users.py similarity index 90% rename from src/shopdb/helpers/users.py rename to src/shop_db2/helpers/users.py index 7ef352c..20b814c 100644 --- a/src/shopdb/helpers/users.py +++ b/src/shop_db2/helpers/users.py @@ -4,10 +4,10 @@ from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, bcrypt, db -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import app, bcrypt, db +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import User def insert_user(data): diff --git a/src/shopdb/helpers/utils.py b/src/shop_db2/helpers/utils.py similarity index 98% rename from src/shopdb/helpers/utils.py rename to src/shop_db2/helpers/utils.py index c8abc3e..61292e0 100644 --- a/src/shopdb/helpers/utils.py +++ b/src/shop_db2/helpers/utils.py @@ -7,7 +7,7 @@ import dateutil.parser from flask import request -import shopdb.exceptions as exc +import shop_db2.exceptions as exc def json_body(): diff --git a/src/shopdb/helpers/validators.py b/src/shop_db2/helpers/validators.py similarity index 98% rename from src/shopdb/helpers/validators.py rename to src/shop_db2/helpers/validators.py index 93687c3..75a1493 100644 --- a/src/shopdb/helpers/validators.py +++ b/src/shop_db2/helpers/validators.py @@ -4,7 +4,7 @@ from flask import request -import shopdb.exceptions as exc +import shop_db2.exceptions as exc def check_forbidden(data, allowed_fields, row): diff --git a/src/shopdb/models/__init__.py b/src/shop_db2/models/__init__.py similarity index 100% rename from src/shopdb/models/__init__.py rename to src/shop_db2/models/__init__.py diff --git a/src/shopdb/models/admin_update.py b/src/shop_db2/models/admin_update.py similarity index 92% rename from src/shopdb/models/admin_update.py rename to src/shop_db2/models/admin_update.py index 7bd6550..7b5d50d 100644 --- a/src/shopdb/models/admin_update.py +++ b/src/shop_db2/models/admin_update.py @@ -5,8 +5,8 @@ from sqlalchemy import func from sqlalchemy.orm import validates -from shopdb.exceptions import UnauthorizedAccess -from shopdb.shared import db +from shop_db2.exceptions import UnauthorizedAccess +from shop_db2.shared import db class AdminUpdate(db.Model): diff --git a/src/shopdb/models/deposit.py b/src/shop_db2/models/deposit.py similarity index 98% rename from src/shopdb/models/deposit.py rename to src/shop_db2/models/deposit.py index 3b155dc..d8298f2 100644 --- a/src/shopdb/models/deposit.py +++ b/src/shop_db2/models/deposit.py @@ -5,7 +5,7 @@ from sqlalchemy import func from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property -from shopdb.shared import db +from shop_db2.shared import db from .revoke import Revoke diff --git a/src/shopdb/models/product.py b/src/shop_db2/models/product.py similarity index 98% rename from src/shopdb/models/product.py rename to src/shop_db2/models/product.py index 381e73c..5449fea 100644 --- a/src/shopdb/models/product.py +++ b/src/shop_db2/models/product.py @@ -9,7 +9,7 @@ from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property from sqlalchemy.orm import column_property, validates -from shopdb.exceptions import ( +from shop_db2.exceptions import ( CouldNotCreateEntry, EntryAlreadyExists, EntryNotFound, @@ -18,8 +18,8 @@ NothingHasChanged, UnauthorizedAccess, ) -from shopdb.helpers.uploads import insert_image -from shopdb.shared import db +from shop_db2.helpers.uploads import insert_image +from shop_db2.shared import db class Product(db.Model): diff --git a/src/shopdb/models/product_price.py b/src/shop_db2/models/product_price.py similarity index 90% rename from src/shopdb/models/product_price.py rename to src/shop_db2/models/product_price.py index 08523c4..92e4035 100644 --- a/src/shopdb/models/product_price.py +++ b/src/shop_db2/models/product_price.py @@ -5,8 +5,8 @@ from sqlalchemy import func from sqlalchemy.orm import validates -from shopdb.exceptions import UnauthorizedAccess -from shopdb.shared import db +from shop_db2.exceptions import UnauthorizedAccess +from shop_db2.shared import db class ProductPrice(db.Model): diff --git a/src/shopdb/models/product_tag_assignment.py b/src/shop_db2/models/product_tag_assignment.py similarity index 89% rename from src/shopdb/models/product_tag_assignment.py rename to src/shop_db2/models/product_tag_assignment.py index f03eade..82582f8 100644 --- a/src/shopdb/models/product_tag_assignment.py +++ b/src/shop_db2/models/product_tag_assignment.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.shared import db +from shop_db2.shared import db product_tag_assignments = db.Table( "product_tag_assignments", diff --git a/src/shopdb/models/purchase.py b/src/shop_db2/models/purchase.py similarity index 96% rename from src/shopdb/models/purchase.py rename to src/shop_db2/models/purchase.py index ac8a578..c1b7ba1 100644 --- a/src/shopdb/models/purchase.py +++ b/src/shop_db2/models/purchase.py @@ -6,8 +6,8 @@ from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property from sqlalchemy.orm import validates -from shopdb.exceptions import EntryNotRevocable, UserIsNotVerified -from shopdb.shared import db +from shop_db2.exceptions import EntryNotRevocable, UserIsNotVerified +from shop_db2.shared import db class PurchaseRevoke(db.Model): diff --git a/src/shopdb/models/rank.py b/src/shop_db2/models/rank.py similarity index 94% rename from src/shopdb/models/rank.py rename to src/shop_db2/models/rank.py index 3727fa3..c3eaf56 100644 --- a/src/shopdb/models/rank.py +++ b/src/shop_db2/models/rank.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.shared import db +from shop_db2.shared import db class Rank(db.Model): diff --git a/src/shopdb/models/rank_update.py b/src/shop_db2/models/rank_update.py similarity index 91% rename from src/shopdb/models/rank_update.py rename to src/shop_db2/models/rank_update.py index db6218e..cb01943 100644 --- a/src/shopdb/models/rank_update.py +++ b/src/shop_db2/models/rank_update.py @@ -5,8 +5,8 @@ from sqlalchemy import func from sqlalchemy.orm import validates -from shopdb.exceptions import UnauthorizedAccess -from shopdb.shared import db +from shop_db2.exceptions import UnauthorizedAccess +from shop_db2.shared import db class RankUpdate(db.Model): diff --git a/src/shopdb/models/replenishment.py b/src/shop_db2/models/replenishment.py similarity index 97% rename from src/shopdb/models/replenishment.py rename to src/shop_db2/models/replenishment.py index 0cae332..4ecaf0a 100644 --- a/src/shopdb/models/replenishment.py +++ b/src/shop_db2/models/replenishment.py @@ -6,9 +6,9 @@ from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property from sqlalchemy.orm import column_property -from shopdb.exceptions import EntryNotRevocable -from shopdb.helpers.utils import parse_timestamp -from shopdb.shared import db +from shop_db2.exceptions import EntryNotRevocable +from shop_db2.helpers.utils import parse_timestamp +from shop_db2.shared import db from .revoke import Revoke diff --git a/src/shopdb/models/revoke.py b/src/shop_db2/models/revoke.py similarity index 92% rename from src/shopdb/models/revoke.py rename to src/shop_db2/models/revoke.py index 408d3b2..22c179a 100644 --- a/src/shopdb/models/revoke.py +++ b/src/shop_db2/models/revoke.py @@ -6,8 +6,8 @@ from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm import validates -from shopdb.exceptions import UnauthorizedAccess -from shopdb.shared import db +from shop_db2.exceptions import UnauthorizedAccess +from shop_db2.shared import db class Revoke: diff --git a/src/shopdb/models/stocktaking.py b/src/shop_db2/models/stocktaking.py similarity index 96% rename from src/shopdb/models/stocktaking.py rename to src/shop_db2/models/stocktaking.py index 9a93330..c47100a 100644 --- a/src/shopdb/models/stocktaking.py +++ b/src/shop_db2/models/stocktaking.py @@ -5,8 +5,8 @@ from sqlalchemy import func from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property -from shopdb.exceptions import InvalidAmount -from shopdb.shared import db +from shop_db2.exceptions import InvalidAmount +from shop_db2.shared import db from .revoke import Revoke diff --git a/src/shopdb/models/tag.py b/src/shop_db2/models/tag.py similarity index 94% rename from src/shopdb/models/tag.py rename to src/shop_db2/models/tag.py index f4536d5..cda405a 100644 --- a/src/shopdb/models/tag.py +++ b/src/shop_db2/models/tag.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.shared import db +from shop_db2.shared import db class Tag(db.Model): diff --git a/src/shopdb/models/upload.py b/src/shop_db2/models/upload.py similarity index 93% rename from src/shopdb/models/upload.py rename to src/shop_db2/models/upload.py index 96df6bc..e8d2a9e 100644 --- a/src/shopdb/models/upload.py +++ b/src/shop_db2/models/upload.py @@ -4,7 +4,7 @@ from sqlalchemy import func -from shopdb.shared import db +from shop_db2.shared import db class Upload(db.Model): diff --git a/src/shopdb/models/user.py b/src/shop_db2/models/user.py similarity index 98% rename from src/shopdb/models/user.py rename to src/shop_db2/models/user.py index 26f2854..1e35c58 100644 --- a/src/shopdb/models/user.py +++ b/src/shop_db2/models/user.py @@ -7,15 +7,15 @@ from sqlalchemy.ext.hybrid import hybrid_method, hybrid_property from sqlalchemy.orm import column_property -from shopdb.exceptions import ( +from shop_db2.exceptions import ( CouldNotCreateEntry, NoRemainingAdmin, NothingHasChanged, UserAlreadyVerified, UserNeedsPassword, ) -from shopdb.helpers.uploads import insert_image -from shopdb.shared import db +from shop_db2.helpers.uploads import insert_image +from shop_db2.shared import db class User(db.Model): diff --git a/src/shopdb/models/user_verification.py b/src/shop_db2/models/user_verification.py similarity index 90% rename from src/shopdb/models/user_verification.py rename to src/shop_db2/models/user_verification.py index 1bef4e3..e07e8e7 100644 --- a/src/shopdb/models/user_verification.py +++ b/src/shop_db2/models/user_verification.py @@ -5,8 +5,8 @@ from sqlalchemy import func from sqlalchemy.orm import validates -from shopdb.exceptions import UnauthorizedAccess -from shopdb.shared import db +from shop_db2.exceptions import UnauthorizedAccess +from shop_db2.shared import db class UserVerification(db.Model): diff --git a/src/shopdb/py.typed b/src/shop_db2/py.typed similarity index 100% rename from src/shopdb/py.typed rename to src/shop_db2/py.typed diff --git a/src/shopdb/routes/__init__.py b/src/shop_db2/routes/__init__.py similarity index 100% rename from src/shopdb/routes/__init__.py rename to src/shop_db2/routes/__init__.py diff --git a/src/shopdb/routes/backups.py b/src/shop_db2/routes/backups.py similarity index 95% rename from src/shopdb/routes/backups.py rename to src/shop_db2/routes/backups.py index 9d5d4d5..cb96552 100644 --- a/src/shopdb/routes/backups.py +++ b/src/shop_db2/routes/backups.py @@ -9,8 +9,8 @@ from flask import jsonify -from shopdb.api import app -from shopdb.helpers.decorators import adminRequired +from shop_db2.api import app +from shop_db2.helpers.decorators import adminRequired @app.route("/backups", methods=["GET"]) diff --git a/src/shopdb/routes/deposits.py b/src/shop_db2/routes/deposits.py similarity index 90% rename from src/shopdb/routes/deposits.py rename to src/shop_db2/routes/deposits.py index e85debf..60a01a2 100644 --- a/src/shopdb/routes/deposits.py +++ b/src/shop_db2/routes/deposits.py @@ -5,15 +5,15 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.deposits import insert_deposit -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Deposit +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.deposits import insert_deposit +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Deposit @app.route("/deposits", methods=["GET"]) diff --git a/src/shopdb/routes/financial_overview.py b/src/shop_db2/routes/financial_overview.py similarity index 93% rename from src/shopdb/routes/financial_overview.py rename to src/shop_db2/routes/financial_overview.py index 83cd859..b05acfc 100644 --- a/src/shopdb/routes/financial_overview.py +++ b/src/shop_db2/routes/financial_overview.py @@ -4,10 +4,10 @@ from flask import jsonify -from shopdb.api import app -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.stocktakings import _get_balance_between_stocktakings -from shopdb.models import Deposit, Purchase, ReplenishmentCollection, StocktakingCollection +from shop_db2.api import app +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.stocktakings import _get_balance_between_stocktakings +from shop_db2.models import Deposit, Purchase, ReplenishmentCollection, StocktakingCollection @app.route("/financial_overview", methods=["GET"]) diff --git a/src/shopdb/routes/images.py b/src/shop_db2/routes/images.py similarity index 93% rename from src/shopdb/routes/images.py rename to src/shop_db2/routes/images.py index e23f600..99c23ce 100644 --- a/src/shopdb/routes/images.py +++ b/src/shop_db2/routes/images.py @@ -6,8 +6,8 @@ from flask import send_from_directory -import shopdb.exceptions as exc -from shopdb.api import app +import shop_db2.exceptions as exc +from shop_db2.api import app @app.route("/images", methods=["GET"], defaults={"imagename": None}) diff --git a/src/shopdb/routes/login.py b/src/shop_db2/routes/login.py similarity index 90% rename from src/shopdb/routes/login.py rename to src/shop_db2/routes/login.py index d85e940..a78ba3a 100644 --- a/src/shopdb/routes/login.py +++ b/src/shop_db2/routes/login.py @@ -7,11 +7,11 @@ import jwt from flask import jsonify -import shopdb.exceptions as exc -from shopdb.api import app, bcrypt -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import app, bcrypt +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import User @app.route("/login", methods=["POST"], endpoint="login") diff --git a/src/shopdb/routes/maintenance.py b/src/shop_db2/routes/maintenance.py similarity index 91% rename from src/shopdb/routes/maintenance.py rename to src/shop_db2/routes/maintenance.py index 68664f9..70115e5 100644 --- a/src/shopdb/routes/maintenance.py +++ b/src/shop_db2/routes/maintenance.py @@ -7,12 +7,12 @@ from flask import jsonify -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from configuration import PATH -from shopdb.api import app -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.utils import json_body -from shopdb.helpers.validators import check_fields_and_types +from shop_db2.api import app +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.utils import json_body +from shop_db2.helpers.validators import check_fields_and_types @app.route("/maintenance", methods=["GET"]) diff --git a/src/shopdb/routes/products.py b/src/shop_db2/routes/products.py similarity index 94% rename from src/shopdb/routes/products.py rename to src/shop_db2/routes/products.py index 246f71f..3726365 100644 --- a/src/shopdb/routes/products.py +++ b/src/shop_db2/routes/products.py @@ -5,15 +5,15 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -import shopdb.helpers.products as product_helpers -from shopdb.api import app, db -from shopdb.helpers.decorators import adminOptional, adminRequired -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Product, Tag, product_tag_assignments +import shop_db2.exceptions as exc +import shop_db2.helpers.products as product_helpers +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminOptional, adminRequired +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Product, Tag, product_tag_assignments @app.route("/products", methods=["GET"]) diff --git a/src/shopdb/routes/purchases.py b/src/shop_db2/routes/purchases.py similarity index 90% rename from src/shopdb/routes/purchases.py rename to src/shop_db2/routes/purchases.py index b2c6464..1f35141 100644 --- a/src/shopdb/routes/purchases.py +++ b/src/shop_db2/routes/purchases.py @@ -6,14 +6,14 @@ from sqlalchemy.exc import IntegrityError from sqlalchemy.sql import exists -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminOptional -from shopdb.helpers.purchases import insert_purchase -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.models import Purchase, PurchaseRevoke +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminOptional +from shop_db2.helpers.purchases import insert_purchase +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.models import Purchase, PurchaseRevoke @app.route("/purchases", methods=["GET"]) diff --git a/src/shopdb/routes/ranks.py b/src/shop_db2/routes/ranks.py similarity index 87% rename from src/shopdb/routes/ranks.py rename to src/shop_db2/routes/ranks.py index 6bbd51a..b5b47af 100644 --- a/src/shopdb/routes/ranks.py +++ b/src/shop_db2/routes/ranks.py @@ -5,14 +5,14 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Rank +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Rank @app.route("/ranks", methods=["GET"]) diff --git a/src/shopdb/routes/replenishmentcollections.py b/src/shop_db2/routes/replenishmentcollections.py similarity index 93% rename from src/shopdb/routes/replenishmentcollections.py rename to src/shop_db2/routes/replenishmentcollections.py index f141c49..bf01206 100644 --- a/src/shopdb/routes/replenishmentcollections.py +++ b/src/shop_db2/routes/replenishmentcollections.py @@ -5,14 +5,14 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body, parse_timestamp -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Product, Replenishment, ReplenishmentCollection, User +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body, parse_timestamp +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Product, Replenishment, ReplenishmentCollection, User @app.route("/replenishmentcollections", methods=["GET"]) diff --git a/src/shopdb/routes/stocktakingcollections.py b/src/shop_db2/routes/stocktakingcollections.py similarity index 94% rename from src/shopdb/routes/stocktakingcollections.py rename to src/shop_db2/routes/stocktakingcollections.py index 4f3acae..8dc426e 100644 --- a/src/shopdb/routes/stocktakingcollections.py +++ b/src/shop_db2/routes/stocktakingcollections.py @@ -14,16 +14,16 @@ from sqlalchemy import func from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -import shopdb.helpers.products as product_helpers -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.stocktakings import _get_balance_between_stocktakings -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body, parse_timestamp -from shopdb.helpers.validators import check_allowed_parameters, check_fields_and_types -from shopdb.models import Product, Stocktaking, StocktakingCollection +import shop_db2.exceptions as exc +import shop_db2.helpers.products as product_helpers +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.stocktakings import _get_balance_between_stocktakings +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body, parse_timestamp +from shop_db2.helpers.validators import check_allowed_parameters, check_fields_and_types +from shop_db2.models import Product, Stocktaking, StocktakingCollection @app.route("/stocktakingcollections/template", methods=["GET"]) diff --git a/src/shopdb/routes/tagassignments.py b/src/shop_db2/routes/tagassignments.py similarity index 89% rename from src/shopdb/routes/tagassignments.py rename to src/shop_db2/routes/tagassignments.py index 14d0414..4bc731d 100644 --- a/src/shopdb/routes/tagassignments.py +++ b/src/shop_db2/routes/tagassignments.py @@ -5,12 +5,12 @@ from flask import jsonify from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.utils import json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Product, Tag +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.utils import json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Product, Tag @app.route("/tagassignment/", methods=["POST"]) diff --git a/src/shopdb/routes/tags.py b/src/shop_db2/routes/tags.py similarity index 91% rename from src/shopdb/routes/tags.py rename to src/shop_db2/routes/tags.py index dcbfaaa..c7eaf2a 100644 --- a/src/shopdb/routes/tags.py +++ b/src/shop_db2/routes/tags.py @@ -5,14 +5,14 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.helpers.decorators import adminRequired -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.helpers.validators import check_fields_and_types -from shopdb.models import Tag +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.helpers.decorators import adminRequired +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.helpers.validators import check_fields_and_types +from shop_db2.models import Tag @app.route("/tags", methods=["GET"]) diff --git a/src/shopdb/routes/users.py b/src/shop_db2/routes/users.py similarity index 95% rename from src/shopdb/routes/users.py rename to src/shop_db2/routes/users.py index 977ac72..b78383d 100644 --- a/src/shopdb/routes/users.py +++ b/src/shop_db2/routes/users.py @@ -5,14 +5,14 @@ from flask import jsonify, request from sqlalchemy.exc import IntegrityError -import shopdb.exceptions as exc -from shopdb.api import app, bcrypt, db -from shopdb.helpers.decorators import adminOptional, adminRequired, checkIfUserIsValid -from shopdb.helpers.query import QueryFromRequestParameters -from shopdb.helpers.updater import generic_update -from shopdb.helpers.users import insert_user -from shopdb.helpers.utils import convert_minimal, json_body -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import app, bcrypt, db +from shop_db2.helpers.decorators import adminOptional, adminRequired, checkIfUserIsValid +from shop_db2.helpers.query import QueryFromRequestParameters +from shop_db2.helpers.updater import generic_update +from shop_db2.helpers.users import insert_user +from shop_db2.helpers.utils import convert_minimal, json_body +from shop_db2.models import User @app.route("/users", methods=["GET"]) diff --git a/src/shopdb/shared/__init__.py b/src/shop_db2/shared/__init__.py similarity index 100% rename from src/shopdb/shared/__init__.py rename to src/shop_db2/shared/__init__.py diff --git a/src/shopdb/templates/stocktakingcollections_template.html b/src/shop_db2/templates/stocktakingcollections_template.html similarity index 100% rename from src/shopdb/templates/stocktakingcollections_template.html rename to src/shop_db2/templates/stocktakingcollections_template.html diff --git a/src/shopdb/uploads/broken_image.jpeg b/src/shop_db2/uploads/broken_image.jpeg similarity index 100% rename from src/shopdb/uploads/broken_image.jpeg rename to src/shop_db2/uploads/broken_image.jpeg diff --git a/src/shopdb/uploads/broken_image.jpg b/src/shop_db2/uploads/broken_image.jpg similarity index 100% rename from src/shopdb/uploads/broken_image.jpg rename to src/shop_db2/uploads/broken_image.jpg diff --git a/src/shopdb/uploads/broken_image.png b/src/shop_db2/uploads/broken_image.png similarity index 100% rename from src/shopdb/uploads/broken_image.png rename to src/shop_db2/uploads/broken_image.png diff --git a/src/shopdb/uploads/default.png b/src/shop_db2/uploads/default.png similarity index 100% rename from src/shopdb/uploads/default.png rename to src/shop_db2/uploads/default.png diff --git a/src/shopdb/uploads/non_quadratic.png b/src/shop_db2/uploads/non_quadratic.png similarity index 100% rename from src/shopdb/uploads/non_quadratic.png rename to src/shop_db2/uploads/non_quadratic.png diff --git a/src/shopdb/uploads/valid_image.jpeg b/src/shop_db2/uploads/valid_image.jpeg similarity index 100% rename from src/shopdb/uploads/valid_image.jpeg rename to src/shop_db2/uploads/valid_image.jpeg diff --git a/src/shopdb/uploads/valid_image.jpg b/src/shop_db2/uploads/valid_image.jpg similarity index 100% rename from src/shopdb/uploads/valid_image.jpg rename to src/shop_db2/uploads/valid_image.jpg diff --git a/src/shopdb/uploads/valid_image.png b/src/shop_db2/uploads/valid_image.png similarity index 100% rename from src/shopdb/uploads/valid_image.png rename to src/shop_db2/uploads/valid_image.png diff --git a/tests/base.py b/tests/base.py index bb96452..a051209 100644 --- a/tests/base.py +++ b/tests/base.py @@ -5,8 +5,8 @@ from flask_testing import TestCase import configuration as config -from shopdb.api import app, bcrypt, db, set_app -from shopdb.models import ( +from shop_db2.api import app, bcrypt, db, set_app +from shop_db2.models import ( AdminUpdate, Deposit, Product, diff --git a/tests/test_default_data.py b/tests/test_default_data.py index 190b177..03502ea 100644 --- a/tests/test_default_data.py +++ b/tests/test_default_data.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.api import bcrypt -from shopdb.models import Rank, User +from shop_db2.api import bcrypt +from shop_db2.models import Rank, User from tests.base import BaseTestCase, rank_data, user_data diff --git a/tests/unit/api/test_api_change_tagassignment.py b/tests/unit/api/test_api_change_tagassignment.py index 751a592..92ec793 100644 --- a/tests/unit/api/test_api_change_tagassignment.py +++ b/tests/unit/api/test_api_change_tagassignment.py @@ -4,12 +4,12 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db +import shop_db2.exceptions as exc +from shop_db2.api import db -# from shopdb.models import Product, Tag -from shopdb.models.product import Product -from shopdb.models.tag import Tag +# from shop_db2.models import Product, Tag +from shop_db2.models.product import Product +from shop_db2.models.tag import Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_batch_deposit.py b/tests/unit/api/test_api_create_batch_deposit.py index a003e9f..cb87190 100644 --- a/tests/unit/api/test_api_create_batch_deposit.py +++ b/tests/unit/api/test_api_create_batch_deposit.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Deposit, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Deposit, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_deposit.py b/tests/unit/api/test_api_create_deposit.py index cb8632a..0cc1bac 100644 --- a/tests/unit/api/test_api_create_deposit.py +++ b/tests/unit/api/test_api_create_deposit.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Deposit, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Deposit, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_product.py b/tests/unit/api/test_api_create_product.py index 80b1b31..6629e4d 100644 --- a/tests/unit/api/test_api_create_product.py +++ b/tests/unit/api/test_api_create_product.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_purchase.py b/tests/unit/api/test_api_create_purchase.py index 14aeeb8..5279b44 100644 --- a/tests/unit/api/test_api_create_purchase.py +++ b/tests/unit/api/test_api_create_purchase.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, Purchase, Rank, Tag, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, Purchase, Rank, Tag, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_rank.py b/tests/unit/api/test_api_create_rank.py index d61996c..01ddd18 100644 --- a/tests/unit/api/test_api_create_rank.py +++ b/tests/unit/api/test_api_create_rank.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Rank +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Rank from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_replenismentcollection.py b/tests/unit/api/test_api_create_replenismentcollection.py index 2a53730..12c5a6e 100644 --- a/tests/unit/api/test_api_create_replenismentcollection.py +++ b/tests/unit/api/test_api_create_replenismentcollection.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, ReplenishmentCollection, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, ReplenishmentCollection, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_stocktakingcollection.py b/tests/unit/api/test_api_create_stocktakingcollection.py index 81738be..5bae8b8 100644 --- a/tests/unit/api/test_api_create_stocktakingcollection.py +++ b/tests/unit/api/test_api_create_stocktakingcollection.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, StocktakingCollection +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, StocktakingCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_tag.py b/tests/unit/api/test_api_create_tag.py index fb1cbf5..ba48b1b 100644 --- a/tests/unit/api/test_api_create_tag.py +++ b/tests/unit/api/test_api_create_tag.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Tag +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_create_user.py b/tests/unit/api/test_api_create_user.py index 1f95440..1886417 100644 --- a/tests/unit/api/test_api_create_user.py +++ b/tests/unit/api/test_api_create_user.py @@ -4,8 +4,8 @@ from copy import copy -import shopdb.exceptions as exc -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.models import User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_delete_tag.py b/tests/unit/api/test_api_delete_tag.py index 0b516b6..ffa8a44 100644 --- a/tests/unit/api/test_api_delete_tag.py +++ b/tests/unit/api/test_api_delete_tag.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, Tag +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_delete_user.py b/tests/unit/api/test_api_delete_user.py index 039ad84..ccf9e50 100644 --- a/tests/unit/api/test_api_delete_user.py +++ b/tests/unit/api/test_api_delete_user.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.models import User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_balance_between_stocktakings.py b/tests/unit/api/test_api_get_balance_between_stocktakings.py index c1954fa..5c065cf 100644 --- a/tests/unit/api/test_api_get_balance_between_stocktakings.py +++ b/tests/unit/api/test_api_get_balance_between_stocktakings.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase from tests.unit.helpers.test_helpers_stocktakings import TestHelpersStocktakingsTestCase diff --git a/tests/unit/api/test_api_get_deposit.py b/tests/unit/api/test_api_get_deposit.py index 7511306..d6d3194 100644 --- a/tests/unit/api/test_api_get_deposit.py +++ b/tests/unit/api/test_api_get_deposit.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import DepositRevoke +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import DepositRevoke from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_financial_overview.py b/tests/unit/api/test_api_get_financial_overview.py index 372897f..315551c 100644 --- a/tests/unit/api/test_api_get_financial_overview.py +++ b/tests/unit/api/test_api_get_financial_overview.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Deposit, ProductPrice, Purchase, ReplenishmentCollection +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Deposit, ProductPrice, Purchase, ReplenishmentCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_image.py b/tests/unit/api/test_api_get_image.py index 163d12b..5cc4bf0 100644 --- a/tests/unit/api/test_api_get_image.py +++ b/tests/unit/api/test_api_get_image.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -import shopdb.exceptions as exc -from shopdb.api import app +import shop_db2.exceptions as exc +from shop_db2.api import app from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_product.py b/tests/unit/api/test_api_get_product.py index c6c035f..b02e0f7 100644 --- a/tests/unit/api/test_api_get_product.py +++ b/tests/unit/api/test_api_get_product.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, Tag +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_product_pricehistory.py b/tests/unit/api/test_api_get_product_pricehistory.py index a06cf71..c73e00d 100644 --- a/tests/unit/api/test_api_get_product_pricehistory.py +++ b/tests/unit/api/test_api_get_product_pricehistory.py @@ -6,9 +6,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, ProductPrice +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, ProductPrice from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_purchase.py b/tests/unit/api/test_api_get_purchase.py index d87d156..ff1da97 100644 --- a/tests/unit/api/test_api_get_purchase.py +++ b/tests/unit/api/test_api_get_purchase.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_rank.py b/tests/unit/api/test_api_get_rank.py index 8579a29..8ed6a16 100644 --- a/tests/unit/api/test_api_get_rank.py +++ b/tests/unit/api/test_api_get_rank.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_replenismencollection.py b/tests/unit/api/test_api_get_replenismencollection.py index 0feb53d..cb075fc 100644 --- a/tests/unit/api/test_api_get_replenismencollection.py +++ b/tests/unit/api/test_api_get_replenismencollection.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_stocktaking_print_template.py b/tests/unit/api/test_api_get_stocktaking_print_template.py index 89aa9b6..2b4aa24 100644 --- a/tests/unit/api/test_api_get_stocktaking_print_template.py +++ b/tests/unit/api/test_api_get_stocktaking_print_template.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_stocktakingcollection.py b/tests/unit/api/test_api_get_stocktakingcollection.py index 45b94a0..e527e08 100644 --- a/tests/unit/api/test_api_get_stocktakingcollection.py +++ b/tests/unit/api/test_api_get_stocktakingcollection.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_tag.py b/tests/unit/api/test_api_get_tag.py index c009139..c6885de 100644 --- a/tests/unit/api/test_api_get_tag.py +++ b/tests/unit/api/test_api_get_tag.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_user.py b/tests/unit/api/test_api_get_user.py index 28b31e7..edfe3ef 100644 --- a/tests/unit/api/test_api_get_user.py +++ b/tests/unit/api/test_api_get_user.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import User from tests.base import user_data from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_user_deposits.py b/tests/unit/api/test_api_get_user_deposits.py index 61a2dfe..adfb873 100644 --- a/tests/unit/api/test_api_get_user_deposits.py +++ b/tests/unit/api/test_api_get_user_deposits.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Deposit, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Deposit, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_user_favorites.py b/tests/unit/api/test_api_get_user_favorites.py index a2ad283..19f36d5 100644 --- a/tests/unit/api/test_api_get_user_favorites.py +++ b/tests/unit/api/test_api_get_user_favorites.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, Purchase, User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, Purchase, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_get_user_purchases.py b/tests/unit/api/test_api_get_user_purchases.py index a946508..1f6a7b6 100644 --- a/tests/unit/api/test_api_get_user_purchases.py +++ b/tests/unit/api/test_api_get_user_purchases.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_backups.py b/tests/unit/api/test_api_list_backups.py index 46e97d4..c3218ae 100644 --- a/tests/unit/api/test_api_list_backups.py +++ b/tests/unit/api/test_api_list_backups.py @@ -7,7 +7,7 @@ from flask import json from pyfakefs import fake_filesystem_unittest -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_deposits.py b/tests/unit/api/test_api_list_deposits.py index f152063..9c0e308 100644 --- a/tests/unit/api/test_api_list_deposits.py +++ b/tests/unit/api/test_api_list_deposits.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_products.py b/tests/unit/api/test_api_list_products.py index f3488e7..a672228 100644 --- a/tests/unit/api/test_api_list_products.py +++ b/tests/unit/api/test_api_list_products.py @@ -4,8 +4,8 @@ from flask import json -from shopdb.api import db -from shopdb.models import Product, Tag +from shop_db2.api import db +from shop_db2.models import Product, Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_purchases.py b/tests/unit/api/test_api_list_purchases.py index 2eb2ed9..25300d0 100644 --- a/tests/unit/api/test_api_list_purchases.py +++ b/tests/unit/api/test_api_list_purchases.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Purchase +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Purchase from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_replenishmentcollections.py b/tests/unit/api/test_api_list_replenishmentcollections.py index dc31ea4..210da81 100644 --- a/tests/unit/api/test_api_list_replenishmentcollections.py +++ b/tests/unit/api/test_api_list_replenishmentcollections.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_stocktakingcollections.py b/tests/unit/api/test_api_list_stocktakingcollections.py index 18e929a..3699fb6 100644 --- a/tests/unit/api/test_api_list_stocktakingcollections.py +++ b/tests/unit/api/test_api_list_stocktakingcollections.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_list_users.py b/tests/unit/api/test_api_list_users.py index e9fb0e2..329cc2f 100644 --- a/tests/unit/api/test_api_list_users.py +++ b/tests/unit/api/test_api_list_users.py @@ -4,8 +4,8 @@ from flask import json -from shopdb.api import db -from shopdb.models import Rank, User +from shop_db2.api import db +from shop_db2.models import Rank, User from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_login.py b/tests/unit/api/test_api_login.py index 1342ad9..3262649 100644 --- a/tests/unit/api/test_api_login.py +++ b/tests/unit/api/test_api_login.py @@ -5,9 +5,9 @@ import jwt from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import User from tests.base import user_data from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_misc.py b/tests/unit/api/test_api_misc.py index 9381d9d..c645f26 100644 --- a/tests/unit/api/test_api_misc.py +++ b/tests/unit/api/test_api_misc.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import app -from shopdb.models import Purchase +import shop_db2.exceptions as exc +from shop_db2.api import app +from shop_db2.models import Purchase from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_query_parameters.py b/tests/unit/api/test_api_query_parameters.py index 92233db..a5f0ccd 100644 --- a/tests/unit/api/test_api_query_parameters.py +++ b/tests/unit/api/test_api_query_parameters.py @@ -4,7 +4,7 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_toggle_maintenance.py b/tests/unit/api/test_api_toggle_maintenance.py index be70c86..f2e0414 100644 --- a/tests/unit/api/test_api_toggle_maintenance.py +++ b/tests/unit/api/test_api_toggle_maintenance.py @@ -8,9 +8,9 @@ from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from configuration import PATH -from shopdb.api import app +from shop_db2.api import app from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_token.py b/tests/unit/api/test_api_token.py index 4a061ac..959c1f5 100644 --- a/tests/unit/api/test_api_token.py +++ b/tests/unit/api/test_api_token.py @@ -7,7 +7,7 @@ import jwt from flask import json -import shopdb.exceptions as exc +import shop_db2.exceptions as exc from tests.base import user_data from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_deposit.py b/tests/unit/api/test_api_update_deposit.py index 98ad9d1..3bf1b67 100644 --- a/tests/unit/api/test_api_update_deposit.py +++ b/tests/unit/api/test_api_update_deposit.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import Deposit +import shop_db2.exceptions as exc +from shop_db2.models import Deposit from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_product.py b/tests/unit/api/test_api_update_product.py index e04a7e6..376458e 100644 --- a/tests/unit/api/test_api_update_product.py +++ b/tests/unit/api/test_api_update_product.py @@ -7,9 +7,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import app, db -from shopdb.models import Product, ProductPrice +import shop_db2.exceptions as exc +from shop_db2.api import app, db +from shop_db2.models import Product, ProductPrice from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_purchase.py b/tests/unit/api/test_api_update_purchase.py index 5993983..b5766f8 100644 --- a/tests/unit/api/test_api_update_purchase.py +++ b/tests/unit/api/test_api_update_purchase.py @@ -4,9 +4,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Product, Purchase +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Product, Purchase from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_rank.py b/tests/unit/api/test_api_update_rank.py index b639a32..25d4812 100644 --- a/tests/unit/api/test_api_update_rank.py +++ b/tests/unit/api/test_api_update_rank.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -import shopdb.exceptions as exc -from shopdb.models import Rank +import shop_db2.exceptions as exc +from shop_db2.models import Rank from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_replenishment.py b/tests/unit/api/test_api_update_replenishment.py index 15163ef..afa25d1 100644 --- a/tests/unit/api/test_api_update_replenishment.py +++ b/tests/unit/api/test_api_update_replenishment.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import Replenishment, ReplenishmentCollection +import shop_db2.exceptions as exc +from shop_db2.models import Replenishment, ReplenishmentCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_replenishmentcollection.py b/tests/unit/api/test_api_update_replenishmentcollection.py index e90739d..ce695cf 100644 --- a/tests/unit/api/test_api_update_replenishmentcollection.py +++ b/tests/unit/api/test_api_update_replenishmentcollection.py @@ -6,8 +6,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import ReplenishmentCollection +import shop_db2.exceptions as exc +from shop_db2.models import ReplenishmentCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_stocktaking.py b/tests/unit/api/test_api_update_stocktaking.py index fb54765..4976a06 100644 --- a/tests/unit/api/test_api_update_stocktaking.py +++ b/tests/unit/api/test_api_update_stocktaking.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import Stocktaking +import shop_db2.exceptions as exc +from shop_db2.models import Stocktaking from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_stocktakingcollection.py b/tests/unit/api/test_api_update_stocktakingcollection.py index 6451aa3..0e8e923 100644 --- a/tests/unit/api/test_api_update_stocktakingcollection.py +++ b/tests/unit/api/test_api_update_stocktakingcollection.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import StocktakingCollection +import shop_db2.exceptions as exc +from shop_db2.models import StocktakingCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_tag.py b/tests/unit/api/test_api_update_tag.py index 5b488e7..20c8602 100644 --- a/tests/unit/api/test_api_update_tag.py +++ b/tests/unit/api/test_api_update_tag.py @@ -4,8 +4,8 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.models import Product, Tag +import shop_db2.exceptions as exc +from shop_db2.models import Product, Tag from tests.base_api import BaseAPITestCase diff --git a/tests/unit/api/test_api_update_user.py b/tests/unit/api/test_api_update_user.py index 7d3289e..3a81c53 100644 --- a/tests/unit/api/test_api_update_user.py +++ b/tests/unit/api/test_api_update_user.py @@ -7,9 +7,9 @@ from flask import json -import shopdb.exceptions as exc -from shopdb.api import app -from shopdb.models import User +import shop_db2.exceptions as exc +from shop_db2.api import app +from shop_db2.models import User from tests.base import user_data from tests.base_api import BaseAPITestCase diff --git a/tests/unit/helpers/test_helpers_products.py b/tests/unit/helpers/test_helpers_products.py index ab57eee..875c25f 100644 --- a/tests/unit/helpers/test_helpers_products.py +++ b/tests/unit/helpers/test_helpers_products.py @@ -4,10 +4,10 @@ from datetime import datetime -import shopdb.exceptions as exc -import shopdb.helpers.products as product_helpers -from shopdb.api import db -from shopdb.models import Product, ProductPrice, Purchase, StocktakingCollection +import shop_db2.exceptions as exc +import shop_db2.helpers.products as product_helpers +from shop_db2.api import db +from shop_db2.models import Product, ProductPrice, Purchase, StocktakingCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/helpers/test_helpers_purchases.py b/tests/unit/helpers/test_helpers_purchases.py index c4a9553..b4a6537 100644 --- a/tests/unit/helpers/test_helpers_purchases.py +++ b/tests/unit/helpers/test_helpers_purchases.py @@ -4,9 +4,9 @@ from datetime import datetime -import shopdb.helpers.purchases as purchase_helpers -from shopdb.api import db -from shopdb.models import Purchase +import shop_db2.helpers.purchases as purchase_helpers +from shop_db2.api import db +from shop_db2.models import Purchase from tests.base_api import BaseAPITestCase diff --git a/tests/unit/helpers/test_helpers_stocktakings.py b/tests/unit/helpers/test_helpers_stocktakings.py index e6f5af9..2d021b8 100644 --- a/tests/unit/helpers/test_helpers_stocktakings.py +++ b/tests/unit/helpers/test_helpers_stocktakings.py @@ -4,9 +4,9 @@ from datetime import datetime -import shopdb.helpers.stocktakings as stocktaking_helpers -from shopdb.api import db -from shopdb.models import Product, ProductPrice, Purchase, ReplenishmentCollection, Stocktaking, StocktakingCollection +import shop_db2.helpers.stocktakings as stocktaking_helpers +from shop_db2.api import db +from shop_db2.models import Product, ProductPrice, Purchase, ReplenishmentCollection, Stocktaking, StocktakingCollection from tests.base_api import BaseAPITestCase diff --git a/tests/unit/models/test_model_deposit.py b/tests/unit/models/test_model_deposit.py index e50b1e0..d536ac6 100644 --- a/tests/unit/models/test_model_deposit.py +++ b/tests/unit/models/test_model_deposit.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.api import db -from shopdb.models import Deposit, User +from shop_db2.api import db +from shop_db2.models import Deposit, User from tests.base import BaseTestCase diff --git a/tests/unit/models/test_model_purchase.py b/tests/unit/models/test_model_purchase.py index 6000660..05edc2f 100644 --- a/tests/unit/models/test_model_purchase.py +++ b/tests/unit/models/test_model_purchase.py @@ -5,8 +5,8 @@ import datetime from copy import copy -from shopdb.api import db -from shopdb.models import Product, ProductPrice, Purchase, User +from shop_db2.api import db +from shop_db2.models import Product, ProductPrice, Purchase, User from tests.base import BaseTestCase diff --git a/tests/unit/models/test_model_tag.py b/tests/unit/models/test_model_tag.py index 2a2d587..73feb29 100644 --- a/tests/unit/models/test_model_tag.py +++ b/tests/unit/models/test_model_tag.py @@ -2,8 +2,8 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -from shopdb.api import db -from shopdb.models import Product, Tag +from shop_db2.api import db +from shop_db2.models import Product, Tag from tests.base import BaseTestCase diff --git a/tests/unit/models/test_model_user.py b/tests/unit/models/test_model_user.py index 0ca0633..1aff1a9 100644 --- a/tests/unit/models/test_model_user.py +++ b/tests/unit/models/test_model_user.py @@ -2,9 +2,9 @@ # -*- coding: utf-8 -*- __author__ = "g3n35i5" -import shopdb.exceptions as exc -from shopdb.api import db -from shopdb.models import Purchase, User, UserVerification +import shop_db2.exceptions as exc +from shop_db2.api import db +from shop_db2.models import Purchase, User, UserVerification from tests.base import BaseTestCase diff --git a/tests/unit/test_app_functions.py b/tests/unit/test_app_functions.py index ede4c5b..3397096 100644 --- a/tests/unit/test_app_functions.py +++ b/tests/unit/test_app_functions.py @@ -2,13 +2,13 @@ from pytest import MonkeyPatch -from shopdb import get_app_name, get_app_version +from shop_db2 import get_app_name, get_app_version def test_get_app_name() -> None: - assert "shopdb" == get_app_name() + assert "shop-db2" == get_app_name() def test_get_app_version(monkeypatch: MonkeyPatch) -> None: - monkeypatch.setattr("shopdb.__version__", "42.0.0") + monkeypatch.setattr("shop_db2.__version__", "42.0.0") assert "42.0.0" == get_app_version() diff --git a/wsgi.py b/wsgi.py index 6ce5886..53097b4 100755 --- a/wsgi.py +++ b/wsgi.py @@ -12,7 +12,7 @@ from gunicorn.six import iteritems import configuration as config -from shopdb.api import app, set_app +from shop_db2.api import app, set_app def number_of_workers():