Skip to content

Commit

Permalink
Fixes #2413 -- update ModelAdmin.log_FOO method signatures (#2414)
Browse files Browse the repository at this point in the history
Renamed the 'object' parameter to 'obj' to be consistent with the
runtime implementation.

Verified against Django 4.2 and the main branch.
  • Loading branch information
sergei-maertens authored Oct 22, 2024
1 parent fbce0b8 commit a98e7e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions django-stubs/contrib/admin/options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ class ModelAdmin(BaseModelAdmin[_ModelT]):
orphans: int = ...,
allow_empty_first_page: bool = ...,
) -> Paginator: ...
def log_addition(self, request: HttpRequest, object: _ModelT, message: Any) -> LogEntry: ...
def log_change(self, request: HttpRequest, object: _ModelT, message: Any) -> LogEntry: ...
def log_deletion(self, request: HttpRequest, object: _ModelT, object_repr: str) -> LogEntry: ...
def log_addition(self, request: HttpRequest, obj: _ModelT, message: Any) -> LogEntry: ...
def log_change(self, request: HttpRequest, obj: _ModelT, message: Any) -> LogEntry: ...
def log_deletion(self, request: HttpRequest, obj: _ModelT, object_repr: str) -> LogEntry: ...
def action_checkbox(self, obj: _ModelT) -> SafeString: ...
def get_actions(self, request: HttpRequest) -> dict[str, tuple[Callable[..., str], str, str] | None]: ...
def get_action_choices(
Expand Down
9 changes: 0 additions & 9 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ django.conf.global_settings.gettext_noop
django.conf.urls.url
django.contrib.admin.FieldListFilter.title
django.contrib.admin.ModelAdmin
django.contrib.admin.ModelAdmin.log_addition
django.contrib.admin.ModelAdmin.log_change
django.contrib.admin.ModelAdmin.log_deletion
django.contrib.admin.StackedInline
django.contrib.admin.TabularInline
django.contrib.admin.action
Expand Down Expand Up @@ -42,9 +39,6 @@ django.contrib.admin.options.InlineModelAdmin
django.contrib.admin.options.InlineModelAdmin.model
django.contrib.admin.options.InlineModelAdmin.template
django.contrib.admin.options.ModelAdmin
django.contrib.admin.options.ModelAdmin.log_addition
django.contrib.admin.options.ModelAdmin.log_change
django.contrib.admin.options.ModelAdmin.log_deletion
django.contrib.admin.options.StackedInline
django.contrib.admin.options.TabularInline
django.contrib.admin.site
Expand Down Expand Up @@ -176,9 +170,6 @@ django.contrib.flatpages.models.FlatPage.url
django.contrib.gis.admin.GISModelAdmin
django.contrib.gis.admin.GISModelAdmin.gis_widget
django.contrib.gis.admin.ModelAdmin
django.contrib.gis.admin.ModelAdmin.log_addition
django.contrib.gis.admin.ModelAdmin.log_change
django.contrib.gis.admin.ModelAdmin.log_deletion
django.contrib.gis.admin.StackedInline
django.contrib.gis.admin.TabularInline
django.contrib.gis.admin.action
Expand Down

0 comments on commit a98e7e7

Please sign in to comment.