I'd like to do something really simple. I have an order with some products related to it. When I set the quantity of a product to 0, I'd like it to destroy itself.

The property quantity is bound to the quantity table column by a mapper.

But when I do product.quantity = 123, _set_quantity does not get called. What am I doing wrong? Using 0.2 latest SVN.

class Product(object):
        
        def _set_quantity(self, quantity):
                print "I GOT CALLED!"
                self.quantity = quantity

        def _get_quantity(self, quantity):
                return self.quantity
        
        quantity = property(_get_quantity, _set_quantity)

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to