Opened 16 years ago
Last modified 14 years ago
#12561 closed
The ``can_delete`` argument of ``generic_inlineformset_factory`` isn't working — at Version 2
| Reported by: | Piaume | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.admin | Version: | 1.1 |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When the can_delete argument of generic_inlineformset_factory is set to False, a "Delete" checkbox is always displayed on the admin site.
Here a short example:
class SomeModel(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = generic.GenericForeignKey('content_type', 'object_id')
class SomeInlineFormset(generic.GenericStackedInline):
model = SomeModel
formset = generic.generic_inlineformset_factory(SomeModel, can_delete=False)
extra = 0
class SomeModelAdmin(admin.ModelAdmin):
inlines = [SomeInlineFormset]
Change History (3)
by , 16 years ago
| Attachment: | django_cantdelete_bug.png added |
|---|
comment:1 by , 16 years ago
| Summary: | The ``cant_delete`` argument of ``generic_inlineformset_factory`` isn't working → The ``can_delete`` argument of ``generic_inlineformset_factory`` isn't working |
|---|
comment:2 by , 16 years ago
| Component: | Contrib apps → django.contrib.admin |
|---|---|
| Description: | modified (diff) |
| milestone: | → 1.2 |
| Triage Stage: | Unreviewed → Accepted |
It's probably not the reason for your original report, but the admin UI merge seems to have completely broken Generic inline formsets. I can't get them to work at all, with or without can_delete.
Note:
See TracTickets
for help on using tickets.
Bug result on the admin site (there is a "Delete" checkbox)