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

Fixed #13407 -- Corrected verbose names for autogenerated m2m models, and cleaned up the default form prefix when an autogenerated m2m through model is used in a formset. Thanks to carljm for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13029 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-04-27 12:35:49 +00:00
parent ffe79b0979
commit 2f9eef1227
4 changed files with 28 additions and 2 deletions

View File

@@ -30,6 +30,20 @@ class Child(models.Model):
def __unicode__(self):
return u'I am %s, a child of %s' % (self.name, self.parent)
class Book(models.Model):
name = models.CharField(max_length=50)
class Author(models.Model):
name = models.CharField(max_length=50)
books = models.ManyToManyField(Book)
class BookInline(admin.TabularInline):
model = Author.books.through
class AuthorAdmin(admin.ModelAdmin):
inlines = [BookInline]
admin.site.register(Author, AuthorAdmin)
class Holder(models.Model):
dummy = models.IntegerField()