﻿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
259	Admin errors with edit_inline and foreign keys.	andrew@…	Adrian Holovaty	"The following model breaks the admin interface:

{{{
#!python
from django.core import meta

# Create your models here.
class Parent(meta.Model):
    fields = (
        meta.CharField('title', maxlength=50),
    )

    admin = meta.Admin()

    def __repr__(self):
        return self.title

class Child(meta.Model):
    fields = (
        meta.CharField('title', maxlength=50),
    )

    admin = meta.Admin()

    def __repr__(self):
        return self.title

class Relate(meta.Model):
    fields = (
        meta.ForeignKey(Parent, edit_inline=True,
                        edit_inline_type=meta.TABULAR),
        meta.ForeignKey(Child),
    )

    def __repr__(self):
        return self.get_parent().title + "" -> "" + self.get_child().title
}}}

If there are no records in the 'relate' table, there appears to be no way to add them.  If there are, then pressing 'save' in the parent admin view when one of the records shows a line of hyphens results in an error."	defect	closed	contrib.admin		major	invalid	ManyToMany edit_inline		Accepted	0	0	0	0	0	0
