This is almost a duplicate of #1939, however, I am getting a TypeError instead of a KeyError.
Minimal example (a commenter to #2522 had the same use case in mind):
from django.db import models
class Node(models.Model):
name = models.CharField('Name', maxlength=30, unique=True)
def __str__(self):
return self.name
class Admin:
pass
class Link(models.Model):
from_node=models.ForeignKey(Node, related_name='has_links_to', edit_inline=True)
to_node=models.ForeignKey(Node, related_name='has_links_from', core=True)
strength=models.FloatField('Strength', max_digits=3, decimal_places=2, core=True)
Trying to add a Node through the Admin gives this traceback (SVN r5061):
Traceback (most recent call last):
File "C:\cygwin\home\Dan\src\django_src\django\template\__init__.py" in render_node
723. result = node.render(context)
File "C:\cygwin\home\Dan\src\django_src\django\template\defaulttags.py" in render
125. nodelist.append(node.render(context))
File "C:\cygwin\home\Dan\src\django_src\django\contrib\admin\templatetags\admin_modify.py" in render
170. bound_related_object = relation.bind(context['form'], original, bound_related_object_class)
File "C:\cygwin\home\Dan\src\django_src\django\db\models\related.py" in bind
129. return bound_related_object_class(self, field_mapping, original)
TypeError at /admin/ntwk/node/add/
'bool' object is not callable