Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0: Add request arg to ModelAdmin.lookup_allowed #1976

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class BaseModelAdmin(Generic[_ModelT]):
def get_prepopulated_fields(self, request: HttpRequest, obj: _ModelT | None = ...) -> dict[str, Sequence[str]]: ...
def get_queryset(self, request: HttpRequest) -> QuerySet[_ModelT]: ...
def get_sortable_by(self, request: HttpRequest) -> _DisplayT[_ModelT]: ...
def lookup_allowed(self, lookup: str, value: str) -> bool: ...
def lookup_allowed(self, lookup: str, value: str, request: HttpRequest | None = ...) -> bool: ...
def to_field_allowed(self, request: HttpRequest, to_field: str) -> bool: ...
def has_add_permission(self, request: HttpRequest) -> bool: ...
def has_change_permission(self, request: HttpRequest, obj: _ModelT | None = ...) -> bool: ...
Expand Down
2 changes: 0 additions & 2 deletions scripts/stubtest/allowlist_todo_django50.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ django.contrib.admin.filters.EmptyFieldListFilter.get_lookup_condition
django.contrib.admin.filters.FacetsMixin
django.contrib.admin.filters.RelatedFieldListFilter.get_facet_counts
django.contrib.admin.filters.SimpleListFilter.get_facet_counts
django.contrib.admin.options.BaseModelAdmin.lookup_allowed
django.contrib.admin.options.IS_FACETS_VAR
django.contrib.admin.sites.AdminSite.get_model_admin
django.contrib.admin.utils.build_q_object_from_lookup_parameters
django.contrib.admin.utils.get_last_value_from_parameters
django.contrib.admin.views.main.ChangeList.get_queryset
django.contrib.auth.admin.UserAdmin.lookup_allowed
django.contrib.auth.hashers.CryptPasswordHasher
django.contrib.auth.hashers.verify_password
django.contrib.contenttypes.fields.GenericForeignKey.get_content_type
Expand Down