diff --git a/src/django_enum/choices.py b/src/django_enum/choices.py index 9882494..bd7b25a 100644 --- a/src/django_enum/choices.py +++ b/src/django_enum/choices.py @@ -25,7 +25,7 @@ ChoicesType = ( model_enums.ChoicesType if django_version[0:2] >= (5, 0) - else model_enums.ChoicesMeta + else getattr(model_enums, "ChoicesMeta") # removed in Django 5.0 ) DEFAULT_BOUNDARY = getattr(enum, "KEEP", None) diff --git a/src/django_enum/fields.py b/src/django_enum/fields.py index 42e4001..5e86d95 100644 --- a/src/django_enum/fields.py +++ b/src/django_enum/fields.py @@ -787,8 +787,8 @@ def contribute_to_class( constraint |= Q(**{f"{self.name or name}__isnull": True}) cls._meta.constraints = [ *cls._meta.constraints, - CheckConstraint( - check=constraint, + CheckConstraint( # type: ignore[call-arg] + check=constraint, # type: ignore[call-arg] name=self.constraint_name(cls, self.name or name, self.enum), ) if django_version[0:2] < (5, 1) @@ -1254,8 +1254,8 @@ def contribute_to_class( cls._meta.constraints = [ *cls._meta.constraints, - CheckConstraint( - check=constraint, + CheckConstraint( # type: ignore[call-arg] + check=constraint, # type: ignore[call-arg] name=self.constraint_name(cls, self.name or name, self.enum), ) if django_version[0:2] < (5, 1) diff --git a/src/django_enum/query.py b/src/django_enum/query.py index 47785d8..4e159db 100644 --- a/src/django_enum/query.py +++ b/src/django_enum/query.py @@ -27,7 +27,7 @@ def process_lhs(self, compiler, connection, lhs=None): return lhs_sql, lhs_params def get_rhs_op(self, connection, rhs): - return connection.operators["exact"] % rhs + return connection.operators["exact"] % rhs # type: ignore[attr-defined] # class ExtraBigFlagMixin: