app/soc/logic/models/base.py
changeset 679 77a286ff6667
parent 673 2433d5c1d7e6
child 689 46db8c4bbffc
equal deleted inserted replaced
678:b982d9175605 679:77a286ff6667
    75     """Returns the logic of the enclosing scope
    75     """Returns the logic of the enclosing scope
    76     """
    76     """
    77 
    77 
    78     return self._scope_logic
    78     return self._scope_logic
    79 
    79 
       
    80   def getScopeDepth(self):
       
    81     """Returns the scope depth for this entity
       
    82 
       
    83     Returns None if any of the parent scopes return None
       
    84     """
       
    85 
       
    86     if not self._scope_logic:
       
    87       return 0
       
    88 
       
    89     depth = self._scope_logic.logic.getScopeDepth()
       
    90     return None if (depth is None) else (depth + 1)
       
    91 
    80   def _updateField(self, model, name, value):
    92   def _updateField(self, model, name, value):
    81     """Hook called when a field is updated.
    93     """Hook called when a field is updated.
    82 
    94 
    83     Base classes should override if any special actions need to be
    95     Base classes should override if any special actions need to be
    84     taken when a field is updated. The field is not updated if the
    96     taken when a field is updated. The field is not updated if the