﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1383	ManyToManyField to a class with a OneToOneField fails	mir@…	Adrian Holovaty	"This refers to django 0.91.

Under the following circumstances, the admin pages for class C fail on update:

class A(meta.Model):
  name = meta.StringField(maxlength=60)

class B(meta.Model):
  a = meta.OneToOneField(A)

class C(meta.Model):
  b = meta.MultiToMultiField(B)


Inserting works, but as soon as you update, there's a bug in the following line:

file core/meta/__init__.py, lines 1139-1140

def method_set_many_to_many(rel_field, self, id_list):
    current_ids = [obj.id for obj in method_get_many_to_many(rel_field, self)]
                   ^^^^^^
Since B is a ""child"" in a OneToOneField, it does not get an ""id"" attribute (instead, the primary key is in the object attribute b_id).

"	defect	closed	contrib.admin	0.91	normal	worksforme	OneToOneField		Unreviewed	0	0	0	0	0	0
