#2522: Error when 2 foreign keys to same Model w/ edit_inline=True
----------------------------------------+-----------------------------------
Reporter: [EMAIL PROTECTED] | Owner: anonymous
Type: defect | Status: assigned
Priority: highest | Milestone:
Component: Admin interface | Version: 0.95
Severity: blocker | Resolution:
Keywords: graph, graphs, FormWrapper |
----------------------------------------+-----------------------------------
Changes (by anonymous):
* owner: [EMAIL PROTECTED] => anonymous
* status: new => assigned
Comment:
Sorry about the format of the previous post, i have never used this
before.
Here is the code again:
{{{
class Graph_Arc(models.Model):
from_Node = models.ForeignKey('GraphNode',related_name='outputArcs',
edit_inline=True)
to_Node =
models.ForeignKey('GraphNode',related_name='inputArcs',core=True)
class Admin:
pass
class GraphNode(models.Model):
value = models.CharField(maxlength=100, verbose_name=_('Valor del
Nodo'))
def __str__(self):
return "%s" % (self.value)
class Admin:
pass
}}}
TRACEBACK WHEN CALLEN THE admin/add PAGE FOR THE GraphNodes:
{{{
Traceback (most recent call last):
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\template\__init__.py" in render_node
706. result = node.render(context)
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\template\defaulttags.py" in render
118. nodelist.append(node.render(context))
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\contrib\admin\templatetags\admin_modify.py" in render
166. bound_related_object = relation.bind(context['form'], original,
bound_related_object_class)
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\db\models\related.py" in bind
126. return bound_related_object_class(self, field_mapping, original)
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\contrib\admin\templatetags\admin_modify.py" in __init__
147. self.form_field_collection_wrappers =
[FormFieldCollectionWrapper(field_mapping ,fields, i)
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\contrib\admin\templatetags\admin_modify.py" in __init__
123. self.bound_fields = [AdminBoundField(field, self.field_mapping,
field_mapping['original'])
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\contrib\admin\views\main.py" in __init__
112. self.form_fields = [field_mapping[name] for name in
self.field.get_manipulator_field_names('')]
File "C:\Python24\lib\site-packages\django-0.95-
py2.4.egg\django\forms\__init__.py" in __getitem__
195. return self.formfield_dict[template_key]
KeyError at /admin/appdemo/graphnode/add/
'from_Node'
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/2522#comment:>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---