On Mon, May 30, 2011 at 09:52:27PM -0700, Gchorn wrote:
> It seems as though the default in Django when creating tables is to
> place a constraint that doesn't allow null values (contrary to what
> I've learned is the default for SQL in general). I have a model which
> has a date attribute, and which I now want to be able to hold null
> values, but when I tried doing this by adding 'null = True' and 'blank
> = True' to the model's field options, Django generates a
Use South (http://south.aeracode.org/).
Or you can run ./manage.py dbshell, and ALTER TABLE yourself, for
example, for PostgreSQL::
ALTER TABLE <app_model> ALTER COLUMN <col> DROP NOT NULL;
--
Kirill Spitsin