Re: Unique fields that allow nulls

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 12:37 PM, Jan Ostrochovsky < jan.ostrochov...@gmail.com> wrote: > > > But I see as an ultimate solution to distinguish between NULL and > empty string for CharField and TextField, as I see it, here is reason > to have it. > > NULL means undefined (or unknown) value, and its

Re: Unique fields that allow nulls

2009-09-09 Thread Jan Ostrochovsky
Karen, thanks for useful workaround. Another (but little bit sick) workaround I see is to create separate class for such field, and an optional OneToOneField to that class... But I see as an ultimate solution to distinguish between NULL and empty string for CharField and TextField, as I see it,

Re: Unique fields that allow nulls

2009-09-09 Thread Karen Tracey
On Wed, Sep 9, 2009 at 9:14 AM, Jan Ostrochovsky wrote: > > Hello, > > I have the exact need, as author of this question: > > http://stackoverflow.com/questions/454436/unique-fields-that-allow-nulls-in-django > . > > I answered on that question because the answer t

Unique fields that allow nulls

2009-09-09 Thread Jan Ostrochovsky
Hello, I have the exact need, as author of this question: http://stackoverflow.com/questions/454436/unique-fields-that-allow-nulls-in-django. I want a value to be unique, if it is not NULL. Database backend allows such construction, but in Django admin I have got this error message when saving