Error when saving form with a manytomany field

15 views
Skip to first unread message

elpaso

unread,
Nov 6, 2009, 5:23:32 AM11/6/09
to Django users
Hello,

I tested both 1.1.1 and SVN trunk and got the same error when saving a
form, any help would be highly appreciated, details follow.

The tables are in place, basically I have a m2m relation between Track
and TrackCategory, if that matters, categories are implemented with
django-mptt.


class TrackCategory(Category):
......

class Track(ResourceBase):
category = models.ManyToManyField(TrackCategory)
......



Exception Value:
__init__() takes exactly 2 arguments (1 given)
Exception Location: /usr/lib/python2.5/site-packages/django/db/models/
fields/related.py in __init__, line 415

The trace shows:

415 super(ManyRelatedManager, self).__init__()

Vars:
Variable Value
ManyRelatedManager
<class 'django.db.models.fields.related.ManyRelatedManager'>
core_filters
{'track__pk': 4L}
instance
<Track: Itinerario piemontese>
join_table
None
model
<class 'resources.models.track.TrackCategory'>
self
<django.db.models.fields.related.ManyRelatedManager object at
0x20a2590>
source_field_name
'track'
symmetrical
False
target_field_name
'trackcategory'
through
<class 'resources.models.Track_category'>

elpaso

unread,
Nov 6, 2009, 12:39:53 PM11/6/09
to Django users

Ok, It turned out to be a wrong (custom) default manager, I thought
the last declared manager was the default one, while as it's clearly
written in the docs, it is the first one which becomes the default.
Reply all
Reply to author
Forward
0 new messages