On Wed, Sep 9, 2009 at 12:37 PM, Jan Ostrochovsky < [email protected]> 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 Python equivalent is > probably None. > ยดยด - empty string - means defined value (and that value is empty > string), and its Python equivalent is empty string. > > We can found many many examples, where some entity has some parameter > defined and in that case it must be unique, or it is not defined at > all. > > Django's general philosophy is that there should be only one "blank" value for character fields, see: http://docs.djangoproject.com/en/dev/ref/models/fields/#null I don't see that fundamentally changing. Nor do I see the choice being changed from empty string to NULL -- it's far to late for a change like that. I see this unique if specified requirement as "an excellent reason" mentioned in that doc to go against the general recommendation to not set null=True on char fields. If there is some clean way to make this particular case work in Django without requiring the user to create custom forms with custom clean methods, then that might be implemented to fix ticket #4136. But I haven't heard a proposal that accomplishes handling this case without changing the default behavior... Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

