Changes between Initial Version and Version 1 of Ticket #30028, comment 2
- Timestamp:
- Dec 12, 2018, 10:01:39 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #30028, comment 2
initial v1 3 3 The situation is actually more complex but boils down to the fact that `has_change_permission` is called with `obj=None`. 4 4 This does not allow individual objects (rows) in the changelist to be editable while others are not: either the whole changelist is editable or it's not. Or am I missing something here? 5 6 ---- 7 8 Edit: 9 10 The admin to reproduce this could be: 11 12 {{{ 13 class ArticleAdmin(models.ModelAdmin): 14 list_display = ("title", "author", "abstract") 15 list_editable = ("title", "author") 16 17 def has_change_permission(self, request, obj=None): 18 if obj is not None: 19 return obj.pk == 1 20 }}} 21 22 In such a case (which is closer to our actual use case), the Article object with ID 1 will not be editable through its changeform but would be through its changelist.