#2536: Mutually referential many-to-one relationship AddManipulator fails.
-------------------------+--------------------------------------------------
Reporter: anonymous | Owner: adrian
Status: new | Component: Database wrapper
Version: | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
-------------------------+--------------------------------------------------
Changes (by Marek Kubica <[EMAIL PROTECTED]>):
* cc: [EMAIL PROTECTED] (added)
Comment:
I'm getting a similar problem here. I tried to add a new `ForeignKey` to
my database without resetting all data. The relevant database-part is a
`Series`-model which was supposed to have a `representative` `ForeignKey`
which should point to a `Watch`-model. The `Watch`-model itself has
another `ForeignKey` referencing the `Series`-model to define which series
it is in. But after adding the new `representative` FK, I cannot display
my existing `Watch`-models in the admin (inspecting them with the shell
works, though). Adding does not work either.
The traceback when I want to display an existing `Watch` is:
{{{
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/django/core/handlers/base.py"
in get_response
77. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.5/site-
packages/django/contrib/admin/views/decorators.py" in _checklogin
55. return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.5/site-
packages/django/views/decorators/cache.py" in _wrapped_view_func
39. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.5/site-
packages/django/contrib/admin/views/main.py" in add_stage
243. manipulator = model.AddManipulator()
File "/usr/local/lib/python2.5/site-
packages/django/db/models/manipulators.py" in __init__
75. self.fields.extend(f.get_manipulator_fields(self.opts, self,
self.change, fol))
File "/usr/local/lib/python2.5/site-packages/django/db/models/related.py"
in get_manipulator_fields
116. if follow.get(f.name, False):
AttributeError at /admin/homepage/watch/add/
'bool' object has no attribute 'get'
}}}
When I try to add a new object I get this in turn:
{{{
>>> Watch.AddManipulator()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.5/site-
packages/django/db/models/manipulators.py", line 75, in __init__
self.fields.extend(f.get_manipulator_fields(self.opts, self,
self.change, fol))
File "/usr/local/lib/python2.5/site-
packages/django/db/models/related.py", line 116, in get_manipulator_fields
if follow.get(f.name, False):
AttributeError: 'bool' object has no attribute 'get'
}}}
My system is
* Django from SVN, currently revision [4458] (updated today)
* Debian Sarge 3.1
* LigHTTPd 1.4.11-2bpo1
* PostgreSQL 7.4.7-6sarge3
* Python 2.5-2~bpo.1 (actually, I built this myself and added a bpo
suffix)
* python2.5-psycopg 1.1.21-3~bpo.1 (this was taken from Ubuntu and
modified for Debian)
But I can say that this is most certainly some issue with Django and not
something related with my setup which works rather good.
--
Ticket URL: <http://code.djangoproject.com/ticket/2536#comment:8>
Django Code <http://code.djangoproject.com/>
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---