Re: setting a model field to null

2009-04-16 Thread rvr
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

Re: setting a model field to null

2009-04-16 Thread Margie
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 = ??? > -

setting a model field to null

2009-04-15 Thread rvr
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