Re: unique_together doesn't work
On Mon, Jul 4, 2011 at 10:43 AM, Szabo, Patrick (LNG-VIE)
<patrick.szabo@lexisnexis.at> wrote:
> Hi,
>
> Sry, i was a little bit unclear.
> Of course i tried to store identical entries (all fields have the same values) and i had no problem doing so. Since most of the files i want to check for can be null i only inputet a titel.
>
>
It might have been nice for you to give this example straight up
(although you haven't actually specified the case clearly, I'm still
just guessing).
So you are creating objects, and 3 of the fields that you have said
are unique_together are undefined, and have Null=True in their field
definition? In databases, NULL is not equal to anything, even NULL.
Eg, NULL == NULL is false.
Therefore, 2 rows in the database with the same title, but with NULL
for the other 3 fields in the unique index, would not be considered as
the same row.
Tom
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home