Skip to content

Commit

Permalink
Add ModelAdmin.show_facets
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Feb 24, 2024
1 parent 7564f79 commit b203e5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import enum
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from typing import Any, Generic, Literal, TypeVar, type_check_only

Expand Down Expand Up @@ -42,6 +43,11 @@ VERTICAL: Literal[2]

_Direction: TypeAlias = Literal[1, 2]

class ShowFacets(enum.Enum):
NEVER: str
ALLOW: str
ALWAYS: str

def get_content_type_for_model(obj: type[Model] | Model) -> ContentType: ...
def get_ul_class(radio_style: int) -> str: ...

Expand Down Expand Up @@ -150,6 +156,7 @@ class ModelAdmin(BaseModelAdmin[_ModelT]):
save_on_top: bool
paginator: type
preserve_filters: bool
show_facets: ShowFacets
inlines: _ListOrTuple[type[InlineModelAdmin]]
add_form_template: _TemplateForResponseT | None
change_form_template: _TemplateForResponseT | None
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ django.contrib.admin.ChoicesFieldListFilter.get_facet_counts
django.contrib.admin.DateFieldListFilter.get_facet_counts
django.contrib.admin.EmptyFieldListFilter.get_facet_counts
django.contrib.admin.EmptyFieldListFilter.get_lookup_condition
django.contrib.admin.ModelAdmin.show_facets
django.contrib.admin.RelatedFieldListFilter.get_facet_counts
django.contrib.admin.ShowFacets
django.contrib.admin.SimpleListFilter.get_facet_counts
Expand All @@ -33,8 +32,6 @@ django.contrib.admin.filters.SimpleListFilter.get_facet_counts
django.contrib.admin.helpers.checkbox
django.contrib.admin.options.BaseModelAdmin.lookup_allowed
django.contrib.admin.options.IS_FACETS_VAR
django.contrib.admin.options.ModelAdmin.show_facets
django.contrib.admin.options.ShowFacets
django.contrib.admin.sites.AdminSite.get_log_entries
django.contrib.admin.sites.AdminSite.get_model_admin
django.contrib.admin.utils.build_q_object_from_lookup_parameters
Expand All @@ -49,7 +46,6 @@ django.contrib.contenttypes.fields.GenericForeignKey.get_prefetch_querysets
django.contrib.contenttypes.prefetch
django.contrib.gis.admin.AdminSite.get_log_entries
django.contrib.gis.admin.AdminSite.get_model_admin
django.contrib.gis.admin.ModelAdmin.show_facets
django.contrib.gis.admin.OpenLayersWidget
django.contrib.gis.admin.options.spherical_mercator_srid
django.contrib.gis.admin.widgets
Expand Down

0 comments on commit b203e5a

Please sign in to comment.