mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06: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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user