Skip to content

Commit a2c8e60

Browse files
committed
make formfield() methods return Any
1 parent dd2c058 commit a2c8e60

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/django_mysql/models/fields/dynamic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from django.db.models import TimeField
2323
from django.db.models import Transform
2424
from django.db.models.sql.compiler import SQLCompiler
25-
from django.forms import Field as FormField
2625
from django.utils.translation import gettext_lazy as _
2726

2827
from django_mysql.models.lookups import DynColHasKey
@@ -292,7 +291,7 @@ def deconstruct(self) -> DeconstructResult:
292291
kwargs["blank"] = False
293292
return name, path, args, kwargs
294293

295-
def formfield(self, *args: Any, **kwargs: Any) -> FormField | None:
294+
def formfield(self, *args: Any, **kwargs: Any) -> Any:
296295
"""
297296
Disabled in forms - there is no sensible way of editing this
298297
"""

src/django_mysql/models/fields/sets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from django.db.models import Model
1212
from django.db.models import TextField
1313
from django.db.models.expressions import BaseExpression
14-
from django.forms import Field as FormField
1514
from django.utils.translation import gettext_lazy as _
1615

1716
from django_mysql.forms import SimpleSetField
@@ -136,7 +135,7 @@ def value_to_string(self, obj: Any) -> str:
136135
vals = self.value_from_object(obj)
137136
return self.get_prep_value(vals)
138137

139-
def formfield(self, **kwargs: Any) -> FormField:
138+
def formfield(self, **kwargs: Any) -> Any:
140139
defaults = {
141140
"form_class": SimpleSetField,
142141
"base_field": self.base_field.formfield(),

0 commit comments

Comments
 (0)