fixes for #270 and #274

This commit is contained in:
collerek
2021-07-21 14:39:23 +02:00
parent 5e0f704864
commit b423c1c56d
6 changed files with 100 additions and 19 deletions

View File

@ -152,7 +152,7 @@ def sqlalchemy_columns_from_model_fields(
if len(model_fields.keys()) == 0:
model_fields["id"] = ormar.Integer(name="id", primary_key=True)
logging.warning(
"Table {table_name} had no fields so auto "
f"Table {new_model.Meta.tablename} had no fields so auto "
"Integer primary key named `id` created."
)
validate_related_names_in_relations(model_fields, new_model)