Skip to content

Commit 44fe439

Browse files
committed
Stricter signature for contribute_to_class
1 parent 5403f22 commit 44fe439

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
@@ -154,8 +154,10 @@ def formfield(self, **kwargs: Any) -> FormField:
154154
defaults.update(kwargs)
155155
return super().formfield(**defaults)
156156

157-
def contribute_to_class(self, cls: type[Model], name: str, **kwargs: Any) -> None:
158-
super().contribute_to_class(cls, name, **kwargs)
157+
def contribute_to_class(
158+
self, cls: type[Model], name: str, private_only: bool = False
159+
) -> None:
160+
super().contribute_to_class(cls, name, private_only=private_only)
159161
self.base_field.model = cls
160162

161163

src/django_mysql/models/fields/sets.py

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

142-
def contribute_to_class(self, cls: type[Model], name: str, **kwargs: Any) -> None:
143-
super().contribute_to_class(cls, name, **kwargs)
142+
def contribute_to_class(
143+
self, cls: type[Model], name: str, private_only: bool = False
144+
) -> None:
145+
super().contribute_to_class(cls, name, private_only=private_only)
144146
self.base_field.model = cls
145147

146148

0 commit comments

Comments
 (0)