﻿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
4633	Unable to serialize a not yet saved model which has many-to-many relation.	Bear	nobody	"If I try to serialize a not yet saved model which has many-to-many relation, it will raise ValueError while serialize many-to-many field.

for instance:

from django.contrib.auth.models import User

u = User(username=""bear"", password=""bear"", email=""blp330@msn.com"")

from django.core import serializers

serializers.serialize(""json"", [u])

=>

ValueError: <class 'django.contrib.auth.models.Group'> instance needs to have a
primary key value before a many-to-many relationship can be used.

This makes inconvenient while use ajax in some situation."		closed	Core (Serialization)	dev		wontfix	model, serialize, many-to-many		Unreviewed	0	0	0	0	0	0
