﻿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
1359	magic-removal: error on save with a model containing a ManyToManyField.	matt	Adrian Holovaty	"Given a simple model with a ManyToMany relation to User:

{{{
from django.db import models
from django.contrib.auth.models import User

class Note(models.Model):
    title = models.CharField(maxlength=200)
    pub_date = models.DateTimeField()
    note = models.TextField()
    users = models.ManyToManyField(User)
    
    class Admin:
        list_display=('title', 'pub_date')
}}}

When saving in the admin, the following error occurs:
{{{
AttributeError at /admin/merlin/note/add/
'Note' object has no attribute 'set_users'
Request Method:  	POST
Request URL: 	http://127.0.0.1:8000/admin/merlin/note/add/
Exception Type: 	AttributeError
Exception Value: 	'Note' object has no attribute 'set_users'
Exception Location: 	/Users/mcroydon/django/django_magic/django/db/models/manipulators.py in save, line 121
}}}

If I add raw_id_admin=True to the users field, a different error is thrown:

{{{
AttributeError at /admin/merlin/note/add/
Options instance has no attribute 'get_model_module'
Request Method:  	POST
Request URL: 	http://127.0.0.1:8000/admin/merlin/note/add/
Exception Type: 	AttributeError
Exception Value: 	Options instance has no attribute 'get_model_module'
Exception Location: 	/Users/mcroydon/django/django_magic/django/db/models/fields/related.py in isValidIDList, line 473
}}}

This applies to the magic-removal branch as of [2307]."	defect	closed	contrib.admin	magic-removal	major	fixed			Unreviewed	0	0	0	0	0	0
