Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

I think I've seen this ORM somewhere before...

Changeset 75

Show
Ignore:
Timestamp:
06/10/05 20:17:41
Author:
fumanchu
Message:

Fix to engines.RuleProperty?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/engines.py

    r74 r75  
    148148 
    149149class RuleProperty(dejavu.UnitProperty): 
    150     def post(self, unit, value): 
    151         eng = unit.sandbox.unit(UnitEngine, ID=unit.EngineID) 
    152         if eng: 
    153             eng.update_final_class() 
     150    def __set__(self, unit, value): 
     151        if self.coerce: 
     152            value = self.coerce(unit, value) 
     153        oldvalue = unit._properties[self.key] 
     154        if oldvalue != value: 
     155            unit._properties[self.key] = value 
     156            if unit.sandbox: 
     157                eng = unit.sandbox.unit(UnitEngine, ID=unit.EngineID) 
     158                if eng: 
     159                    eng.update_final_class() 
    154160 
    155161class UnitEngineRule(dejavu.Unit):