#9062: admin disallows saving Null fk to more than one object
----------------------------------+-----------------------------------------
 Reporter:  smcoll                |       Owner:  nobody    
   Status:  new                   |   Milestone:            
Component:  django.contrib.admin  |     Version:  1.0       
 Keywords:                        |       Stage:  Unreviewed
Has_patch:  0                     |  
----------------------------------+-----------------------------------------
 {{{
 from django.db import models
 from django.contrib.auth.models import User

 class Contact(models.Model):
     user = models.ForeignKey(User, unique=True, null=True, blank=True)
 }}}

 In the admin, you can't save more than one model with a Null (-------) fk
 because you get an error: "Contact with this User already exists."

 So it's as if Django is treating the "no relation" selection as an FK
 itself, and since unique=True, no more than one model can have a Null fk.

 In my understanding, the model above should allow for any number of Null
 relations, but only allow one relation per User instance.

 Might possibly be related to #9039.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9062>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to