Skip to content

Commit

Permalink
make formfield() methods return Any
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz committed Sep 9, 2024
1 parent dd2c058 commit a2c8e60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/django_mysql/models/fields/dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from django.db.models import TimeField
from django.db.models import Transform
from django.db.models.sql.compiler import SQLCompiler
from django.forms import Field as FormField
from django.utils.translation import gettext_lazy as _

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

def formfield(self, *args: Any, **kwargs: Any) -> FormField | None:
def formfield(self, *args: Any, **kwargs: Any) -> Any:
"""
Disabled in forms - there is no sensible way of editing this
"""
Expand Down
3 changes: 1 addition & 2 deletions src/django_mysql/models/fields/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from django.db.models import Model
from django.db.models import TextField
from django.db.models.expressions import BaseExpression
from django.forms import Field as FormField
from django.utils.translation import gettext_lazy as _

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

def formfield(self, **kwargs: Any) -> FormField:
def formfield(self, **kwargs: Any) -> Any:
defaults = {
"form_class": SimpleSetField,
"base_field": self.base_field.formfield(),
Expand Down

0 comments on commit a2c8e60

Please sign in to comment.