Trying to use edit_inline where it references the foreign key model twice causes an error in the admin interface. This error will be thrown:
TypeError at /admin/test/list/add/
'bool' object is not callable
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/test/list/add/
Exception Type: TypeError
Exception Value: 'bool' object is not callable
Exception Location: C:\Python25\Lib\site-packages\django\db\models\related.py in bind, line 129
When you try to reference the foreign key model twice as in this code:
from django.db import models
class List(models.Model):
name =models.CharField(maxlength=128)
class Admin:
pass
class Entry(models.Model):
list = models.ForeignKey(List, edit_inline=models.TABULAR)
name = models.CharField(maxlength=128, core=True)
to = models.ForeignKey(List, null=True, blank=True, related_name='to')
This issue was also discussed on the mailing list here: http://groups.google.com/group/django-users/browse_frm/thread/8a42d9329c0920cb/211b1cd7b78be471