Nis Jørgensen skrev:
> [EMAIL PROTECTED] skrev:
>   
>> OK, fixed the above problem -- figured out that it was related to my
>> setting unique=True on a field. But that raises the larger question...
>>
>> I have a bit of data that may or may not exist... a identifier on the
>> user that not all users will have, but if they DO have it, it needs to
>> be unique to that user. Apparently, unique=True isn't what I want,
>> because the second user without it throws the above duplicate entry
>> error, so how do I handle that?
>>   
>>     
> I believe the behavior depends on your database backend. Postgresql does
> what you want.
>
> Postgresql is, AFAICT, complying with at least one of the SQL standards
> (but I don't have a copy of those)
>   
It seems mysql 5 works the same way as postgres - and it seems the error
message you quoted was from postgres.

It seems to me you do not have  null=True set for the Field. Thus blank
values are stored as empty strings, which unlike NULLS are equal to each
other.

/Nis




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to