blah.foo = None should do the trick

On Apr 15, 8:01 pm, rvr <rvanro...@gmail.com> 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 = ???
> --
>
> None doesn't seem to work and I don't seem to be able to figure this
> out from the documentation. Thanks for your help.
>
> ~rvr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to