Skip to content

Commit e0a659f

Browse files
committed
Stricter signature for contribute_to_class
1 parent 2f014cf commit e0a659f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/django_mysql/models/fields/lists.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ def formfield(self, **kwargs: Any) -> FormField:
163163
defaults.update(kwargs)
164164
return super().formfield(**defaults)
165165

166-
def contribute_to_class(self, cls: type[Model], name: str, **kwargs: Any) -> None:
167-
super().contribute_to_class(cls, name, **kwargs)
166+
def contribute_to_class(
167+
self, cls: type[Model], name: str, private_only: bool = False
168+
) -> None:
169+
super().contribute_to_class(cls, name, private_only=private_only)
168170
self.base_field.model = cls
169171

170172

src/django_mysql/models/fields/sets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,10 @@ def formfield(self, **kwargs: Any) -> FormField:
145145
defaults.update(kwargs)
146146
return super().formfield(**defaults)
147147

148-
def contribute_to_class(self, cls: type[Model], name: str, **kwargs: Any) -> None:
149-
super().contribute_to_class(cls, name, **kwargs)
148+
def contribute_to_class(
149+
self, cls: type[Model], name: str, private_only: bool = False
150+
) -> None:
151+
super().contribute_to_class(cls, name, private_only=private_only)
150152
self.base_field.model = cls
151153

152154

0 commit comments

Comments
 (0)