Skip to content

Commit c796a86

Browse files
committed
make formfield() methods return Any
1 parent 2dbe884 commit c796a86

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
@@ -20,7 +20,6 @@
2020
from django.db.models import TimeField
2121
from django.db.models import Transform
2222
from django.db.models.sql.compiler import SQLCompiler
23-
from django.forms import Field as FormField
2423
from django.utils.translation import gettext_lazy as _
2524

2625
from django_mysql.models.lookups import DynColHasKey
@@ -290,7 +289,7 @@ def deconstruct(self) -> DeconstructResult:
290289
kwargs["blank"] = False
291290
return name, path, args, kwargs
292291

293-
def formfield(self, *args: Any, **kwargs: Any) -> FormField | None:
292+
def formfield(self, *args: Any, **kwargs: Any) -> Any:
294293
"""
295294
Disabled in forms - there is no sensible way of editing this
296295
"""

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)