From dd4fc2c8ec40005c753cdf1887ca5cfea150fcdb Mon Sep 17 00:00:00 2001 From: collerek Date: Fri, 28 Aug 2020 16:12:17 +0200 Subject: [PATCH] ignore no of arguments warning in model_fields flake qa --- ormar/fields/model_fields.py | 4 ++-- ormar/models/metaclass.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ormar/fields/model_fields.py b/ormar/fields/model_fields.py index dd81838..8ff1dd7 100644 --- a/ormar/fields/model_fields.py +++ b/ormar/fields/model_fields.py @@ -57,7 +57,7 @@ class String(ModelFieldFactory): _bases = (pydantic.ConstrainedStr, BaseField) _type = str - def __new__( + def __new__( # noqa CFQ002 cls, *, allow_blank: bool = False, @@ -231,7 +231,7 @@ class Decimal(ModelFieldFactory): _bases = (pydantic.ConstrainedDecimal, BaseField) _type = decimal.Decimal - def __new__( + def __new__( # noqa CFQ002 cls, *, minimum: float = None, diff --git a/ormar/models/metaclass.py b/ormar/models/metaclass.py index 2e13022..8bc820d 100644 --- a/ormar/models/metaclass.py +++ b/ormar/models/metaclass.py @@ -15,7 +15,7 @@ from ormar.relations import AliasManager if TYPE_CHECKING: # pragma no cover from ormar import Model -relationship_manager = AliasManager() +alias_manager = AliasManager() class ModelMeta: @@ -30,7 +30,7 @@ class ModelMeta: def register_relation_on_build(table_name: str, field: ForeignKey) -> None: - relationship_manager.add_relation_type(field, table_name) + alias_manager.add_relation_type(field, table_name) def reverse_field_not_already_registered( @@ -193,7 +193,7 @@ class ModelMetaclass(pydantic.main.ModelMetaclass): mcs, name, bases, attrs ) - new_model.Meta.alias_manager = relationship_manager + new_model.Meta.alias_manager = alias_manager new_model.objects = QuerySet(new_model) return new_model