On Saturday 26 Nov 2005 11:57 pm, Adrian Holovaty wrote:
> On 11/26/05, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> > i have a table
> > name varchar not null
> > title varchar not null
> > blurb varchar not null
> >
> > in django, if i want to insert a new record and just give a
> > value for the 'name' field and no values for the rest - it gets
> > saved. Postgresql should barf saying 'lack of value in xxx
> > field violates not null constraint' but it doesnt. This looks
> > very much like a serious bug to me
>
> Django does indeed put in the "NOT NULL"s when outputting its
> CREATE TABLE statements. What's happening in your case is that
> the title and blurb fields are getting their default value, which
> is "" (the empty string).

so how do you prevent that? i dont like to waste code checking if 
all the mandatory fields are filled - i want postgres to do that. 
Looking at the table, there is no mention of a default value.
>
> Adrian
>
> --
> Adrian Holovaty
> holovaty.com | djangoproject.com | chicagocrime.org

-- 
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.org.in
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!

Reply via email to