1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #12561. InlineAdmin now respects can_delete=False. Thanks, nessita.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2010-02-23 17:14:50 +00:00
parent 10b1871441
commit f2d5582c53
9 changed files with 95 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ Testing of admin inline formsets.
"""
from django.db import models
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
@@ -29,6 +30,24 @@ class Child(models.Model):
def __unicode__(self):
return u'I am %s, a child of %s' % (self.name, self.parent)
class Holder(models.Model):
dummy = models.IntegerField()
class Inner(models.Model):
dummy = models.IntegerField()
holder = models.ForeignKey(Holder)
class InnerInline(admin.StackedInline):
model = Inner
can_delete = False
# Test bug #12561
admin.site.register(Holder, inlines=[InnerInline])
__test__ = {'API_TESTS': """
# Regression test for #9362
@@ -48,4 +67,4 @@ inline form.
<Child: I am Joe, a child of John>
"""
}
}