[orm-devel] Question: setting an object's many2one attribute to a "None" value

Michael Watkins orm-devel@mailman.tux4web.de
Sun, 31 Aug 2003 08:56:01 -0700


Scenario:

- Product.type_id has once upon a time been set to a Type object
instance (which is a many2one type relationship)

- The business requirement is to remove the relationship, such that
Product.type_id is effectively a None

Simply setting

	product_instance.type_id = None

Will fail of couse, since the class expects a dbobj on the right hand
side, not None.

I've been puzzling through how to do this and perhaps have not had
enough coffee. I'm surprised I've gone this long without having to do
this, but... here I am!

Mike