Skip to content

Commit

Permalink
fixup! Annotate remaining ModelAdmin fields with ClassVar
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Mar 4, 2025
1 parent c04bbc9 commit 3e2fdc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ _ListFilterT: TypeAlias = (
_ModelT = TypeVar("_ModelT", bound=Model)
_DisplayT: TypeAlias = _ListOrTuple[str | Callable[[_ModelT], str | bool]]

# Options `form`, `list_display`, `list_display_links` and `actions` are not marked as `ClassVar` due to the
# limitations of the current type system: `ClassVar` cannot contain type variables.
class BaseModelAdmin(Generic[_ModelT]):
autocomplete_fields: ClassVar[_ListOrTuple[str]]
raw_id_fields: ClassVar[_ListOrTuple[str]]
Expand Down

0 comments on commit 3e2fdc8

Please sign in to comment.