On 20-6-2012 0:49, André Pang wrote: > The idea is to try to ensure that no empty strings make it to the > database, so you're not allowed to insert them into the database. You > can ensure this at the Django (ORM) layer right now with blank=True for > the admin or by checking the blank attribute manually in your own code, > but there's no database-level restriction, which is what I'm after.
Because this would break consistency. Your application would behave differently for different backends, which is rather confusing. Your change would throw null violation errors when blank values are inserted /only in Oracle/. So when empty strings are possibilities the backend has to enforce "NULL is ok" on the field definition to keep behavior consistent. If blank values are not acceptable in your application, you'd do this in your model definition and form validation. Your real issue is with the SQL standards body and Oracle and whoever thought it was a good idea to make NULL and "value of zero length" different concepts. -- Melvyn Sopacua -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.