#12561: The ``can_delete`` argument of ``generic_inlineformset_factory`` isn't
working
-------------------------------------------+--------------------------------
Reporter: Piaume | Owner: nobody
Status: new | Milestone: 1.2
Component: django.contrib.admin | Version: 1.1
Resolution: | Keywords:
Stage: Accepted | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-------------------------------------------+--------------------------------
Changes (by russellm):
* stage: Unreviewed => Accepted
* component: Contrib apps => django.contrib.admin
* milestone: => 1.2
Old description:
> When the ``cant_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]
> }}}
>
> http://img8.imageshack.us/img8/3323/screenshotbe.png
New description:
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]
}}}
http://img8.imageshack.us/img8/3323/screenshotbe.png
Comment:
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.
--
Ticket URL: <http://code.djangoproject.com/ticket/12561#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.