loaddata problem with boolean null in fixture - anyone seen this?

2007-12-06 Thread Shev
One of my models has a field like this: confirm = BooleanField(blank=True, null=true) When I use Django's dumpdata command to export my data to a fixture, and then try to re-import with loaddata, I see an error message that looks like this: Problem installing fixture '/foo/bar/datadump.json'

Re: loaddata problem with boolean null in fixture - anyone seen this?

2007-12-06 Thread ashwoods
did u add that after a syncdb maybe? On 6 Dez., 21:55, Shev <[EMAIL PROTECTED]> wrote: > One of my models has a field like this: > > confirm = BooleanField(blank=True, null=true) > > When I use Django's dumpdata command to export my data to a fixture, > and then try to re-import with loaddata, I

Re: loaddata problem with boolean null in fixture - anyone seen this?

2007-12-06 Thread Shev
If you mean, add the field/column - sort of. It was added to a database in use, I used dbmigration to handle the upgrade. Regardless, I don't see why the loaddata command should choke on a null value for a Boolean if the models.py allows it. On Dec 6, 4:25 pm, ashwoods <[EMAIL PROTECTED]> wro

Re: loaddata problem with boolean null in fixture - anyone seen this?

2007-12-06 Thread Malcolm Tredinnick
On Thu, 2007-12-06 at 14:38 -0800, Shev wrote: [...] > Regardless, I don't see why the loaddata command should choke on a > null value for a Boolean if the models.py allows it. This is a mistaken assumption. Since some of the constraints specified in models.py are enforced at the database level,

Re: loaddata problem with boolean null in fixture - anyone seen this?

2007-12-07 Thread Shev
Yes, thanks, I'd agree and understand that whatever is in the models.py cannot and should not override what's specified in the database. In this case, a NULL for my BooleanField() is actually allowed in the Postgres database as well. And given the error message, it would seem to be a problem wit

Re: loaddata problem with boolean null in fixture - anyone seen this?

2008-01-02 Thread Shev
It turns out this problem has been reported by others, see ticket http://code.djangoproject.com/ticket/5563 The easiest solution in this case was to change the type of the field, from models.BooleanField to models.NullBooleanField, and now null values from the dumpdata are loaded without a proble