Greetings Alchemists,
  Is it possible to define a hook in a mapped class that will be called
to test the sanity of an instance before it gets committed?

As an example:

  class Item(object):
    def _pre_commit(self):
      assert (self.dry_weight + self.fluids) < 50
  mapper(Item, items_table)

I don't want to put the test mutators of dry_weight or fluids since
it's OK to have a temporary inconsistent state as long as the state is
consistent at commit time.

I see that some of this functionality if covered by MapperExtention
but since the test is only related to Item I'd rather put the test in
it.
 
-- 
Yannick Gingras

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to