diff --git a/omymodels/logic.py b/omymodels/logic.py index 58ae027..9482fd6 100644 --- a/omymodels/logic.py +++ b/omymodels/logic.py @@ -1,11 +1,12 @@ from typing import Dict, List + import omymodels.types as t def generate_column( column_data: Dict, table_pk: List[str], table_data: Dict, templates, obj ) -> str: - """ method to generate full column defention for sqlalchemy & gino ORM models """ + """method to generate full column defention for sqlalchemy & gino ORM models""" column_type = t.prepare_column_type_orm(obj, column_data) column = templates.column_template.format( column_name=column_data.name, column_type=column_type @@ -53,7 +54,6 @@ def setup_column_attributes( if column_data.unique: column += templates.unique - return column diff --git a/tests/functional/generator/test_gino_models.py b/tests/functional/generator/test_gino_models.py index ae74441..ca74676 100644 --- a/tests/functional/generator/test_gino_models.py +++ b/tests/functional/generator/test_gino_models.py @@ -1,4 +1,5 @@ import os + from omymodels import create_models @@ -296,7 +297,7 @@ class Products(db.Model): ID = db.Column(db.Integer(), primary_key=True) merchant_id = db.Column(db.Integer(), db.ForeignKey('merchants.id'), nullable=False) """ - + ddl = """ CREATE TABLE "merchants" ( "id" int PRIMARY KEY, @@ -310,5 +311,5 @@ class Products(db.Model): ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id"); """ - result = create_models(ddl, models_type='gino', no_auto_snake_case=True)['code'] - assert expected == result \ No newline at end of file + result = create_models(ddl, models_type="gino", no_auto_snake_case=True)["code"] + assert expected == result diff --git a/tests/functional/generator/test_sqlalchemy_core.py b/tests/functional/generator/test_sqlalchemy_core.py index 1d4bad6..1cdd06e 100644 --- a/tests/functional/generator/test_sqlalchemy_core.py +++ b/tests/functional/generator/test_sqlalchemy_core.py @@ -135,5 +135,5 @@ class Products(Base): ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id"); """ - result = create_models(ddl, models_type='sqlalchemy')['code'] - assert result == expected \ No newline at end of file + result = create_models(ddl, models_type="sqlalchemy")["code"] + assert result == expected