Obviously I misread something. None works perfectly. Thanks very much.
On Apr 16, 3:05 pm, Margie wrote:
> blah.foo = None should do the trick
>
> On Apr 15, 8:01 pm, rvr wrote:
>
>
>
> > How can I set a model field to null after it has had a non-null value?
>
> > --
> > class Blah(models.Model
blah.foo = None should do the trick
On Apr 15, 8:01 pm, rvr wrote:
> How can I set a model field to null after it has had a non-null value?
>
> --
> class Blah(models.Model):
> foo = models.IntegerField(null=True)
>
> blah = Blah()
> blah.foo = 5
>
> # now set it to null
> blah.foo = ???
> -
How can I set a model field to null after it has had a non-null value?
--
class Blah(models.Model):
foo = models.IntegerField(null=True)
blah = Blah()
blah.foo = 5
# now set it to null
blah.foo = ???
--
None doesn't seem to work and I don't seem to be able to figure this
out from the docum
3 matches
Mail list logo