-
-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Marking default_error_messages as a ClassVar (#2457)
This is only ever a dictionary defined on the class and not being defined as a ClassVar means in projects using django-stubs it's not possible to comply with https://docs.astral.sh/ruff/rules/mutable-class-default/
- Loading branch information
Showing
7 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from typing import Any | ||
from typing import Any, ClassVar | ||
|
||
from django import forms | ||
from django.db.models.fields import _ErrorMessagesDict | ||
from django.forms.fields import _ClassLevelWidgetT | ||
|
||
class HStoreField(forms.CharField): | ||
widget: _ClassLevelWidgetT | ||
default_error_messages: _ErrorMessagesDict | ||
default_error_messages: ClassVar[_ErrorMessagesDict] | ||
def prepare_value(self, value: Any) -> Any: ... | ||
def to_python(self, value: Any) -> dict[str, str | None]: ... # type: ignore[override] | ||
def has_changed(self, initial: Any, data: Any) -> bool: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters