﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12209	ManyToManyField.through does not work as the model property of an inline when specified using a string	David Gouldin	nobody	"Using the following models:

{{{
class Author(models.Model):
    name = models.CharField(max_length=100)

class Book(models.Model):
    name = models.CharField(max_length=100)
    authors = models.ManyToManyField(Author, through='AuthorsBooks')

class AuthorsBooks(models.Model):
    author = models.ForeignKey(Author)
    book = models.ForeignKey(Book)
}}}

... with this admin:

{{{
class AuthorsInline(admin.TabularInline):
    model = models.Book.authors.through

class BookAdmin(admin.ModelAdmin):
    inlines = [AuthorsInline]
    exclude = ('authors',)

admin.site.register(models.Book, BookAdmin)
}}}

... does not function.  If you change the models to:

{{{
class AuthorsBooks(models.Model):
    author = models.ForeignKey('Author')
    book = models.ForeignKey('Book')

class Author(models.Model):
    name = models.CharField(max_length=100)

class Book(models.Model):
    name = models.CharField(max_length=100)
    authors = models.ManyToManyField(Author, through=AuthorsBooks)
}}}

... the admin works just fine. This seems to be an issue with specifying Book.authors.through as a string instead of using the model class itself."		closed	contrib.admin	1.1		fixed		dgouldin@…	Unreviewed	0	0	0	0	0	0
