Re: Oracle: blank, null, and empty_strings_allowed

2012-06-21 Thread Ian
On Thursday, June 21, 2012 4:37:35 AM UTC-6, Melvyn Sopacua wrote: > > Which is /exactly/ why I mention it. If the default value is inserted > instead of an empty string, you can pre-insert the default value and > have it linked to an invalid entry. Any attempts to insert the default > value on

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-21 Thread Ian
On Wednesday, June 20, 2012 1:38:45 PM UTC-6, André Pang wrote: > > 1. In Oracle's case, what if you have a model with a primary key that's > a CharField? I suspect that Oracle backend will coerce that to be > null=True, so now you have a primary key field that could have NULL. > Primary keys

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-21 Thread Melvyn Sopacua
On 20-6-2012 21:38, André Pang wrote: > On 6/20/2012 11:46 AM, Melvyn Sopacua wrote: > >> On 20-6-2012 20:31, André Pang wrote: >>> Right. There's currently no way to enforce required=True at the database >>> level. >> >> So, your model clearly defines that it doesn't allow empty values, yet >>

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Ian Kelly
On Wed, Jun 20, 2012 at 12:31 PM, André Pang wrote: > I honestly don't mind whether Django decides to do this or not, since I can > always hack our local tree to enforce this at the database level, but I > thought it's an idea worth discussing. In my case, I found a couple

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread André Pang
On 6/20/2012 11:46 AM, Melvyn Sopacua wrote: On 20-6-2012 20:31, André Pang wrote: Right. There's currently no way to enforce required=True at the database level. So, your model clearly defines that it doesn't allow empty values, yet some were inserted? Can you pull this out of the abstract

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Melvyn Sopacua
On 20-6-2012 20:31, André Pang wrote: > Right. There's currently no way to enforce required=True at the database > level. So, your model clearly defines that it doesn't allow empty values, yet some were inserted? Can you pull this out of the abstract with an example? > I honestly don't mind

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread André Pang
Right. There's currently no way to enforce required=True at the database level. I honestly don't mind whether Django decides to do this or not, since I can always hack our local tree to enforce this at the database level, but I thought it's an idea worth discussing. In my case, I found a

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Thomas Lockhart
On 6/20/12 3:33 AM, Melvyn Sopacua wrote: 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

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Melvyn Sopacua
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

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-19 Thread Kurtis Mullins
So you're trying to, basically, enforce "required=True" at the database-level? On Tue, Jun 19, 2012 at 7:23 PM, Ian wrote: > On Monday, June 18, 2012 5:59:27 PM UTC-6, André Pang wrote: >> >> What I'd like to do is (1) disallow NULLs, and (2) disallow empty >> strings.

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-19 Thread Ian
On Monday, June 18, 2012 5:59:27 PM UTC-6, André Pang wrote: > > What I'd like to do is (1) disallow NULLs, and (2) disallow empty strings. > It looks like there's no current way to do this with Oracle since the > backend overrides null to always be True, and blank is an admin validation >

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-19 Thread André Pang
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

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread Kurtis Mullins
I've read over this many a time -- never paid much attention because I don't use Oracle: https://docs.djangoproject.com/en/dev/ref/models/fields/#null Anyways, if you don't allow NULL and you don't allow empty strings, what are you going to put in there when there's nothing? On Mon, Jun 18, 2012

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread André Pang
On Jun 18, 2012, at 4:05 PM, Ian wrote: >> I'd assume that Django would only generate schemas where NULL is allowed for >> fields where blank=True, and that fields where blank=False would have "NOT >> NULL" included in the Oracle DDL. > > blank=True is a validation option, not a database

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread Ian
On Monday, June 18, 2012 2:17:26 PM UTC-6, André Pang wrote: > > Hi all, > > The Django Oracle documentation has the following to say about NULL and > empty > strings > (emphasis > mine): > > Django generally

Oracle: blank, null, and empty_strings_allowed

2012-06-18 Thread André Pang
Hi all, The Django Oracle documentation has the following to say about NULL and empty strings (emphasis mine): Django generally prefers to use the empty string ('') rather than NULL, but > Oracle treats both