S
Как добавить items в модель Order ?
пытаюсь Order.objects.create(items=Объект модели)
получаю ошибку, но не понимаю её
TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use items.set() instead.Size: a a a
S
TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use items.set() instead.A
Order.items.set(объект_модели) не пробовали?o
S
Order.items.set(объект_модели) не пробовали?A
A
Order.items.add(объект_модели)S
Order.items.add(объект_модели)A
A
S
A
W
A
TypeError: Direct assignment to the forward side of a many-to-many set is prohibited. Use items.set() instead.S
A
order = Order()
order.save()
order.add(m2m_obj)
S
W
S
D
S