Hello everybody,

I have to implement a stated object:

class StatedObject(SQLObject):
    state=EnumCol(enumValues=["Enable",
                                                 "Disable"])

so when inserting a new entry should allow any of the states:

enabled=StatedObject(state="Enable")

disabled=StatedObject(state="Disable")

but when changing it only allow some of them:

enabled.state="Disable"

others should raise an exception:

disabled.state="Enable"
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
change not allowed.

- In the example an entry disabled should not be posible to re-enable.

The problem could be put on this way: "How can I detect an Insert from an Update inside a setter?"

Thanks for your comments.
--
Julio