def fragcascade(attr, seq_type, doc=''):
 assert (seq_type in ('hit', 'query'))
 attr_name = ('_%s_%s' % (seq_type, attr))
 def getter(self):
  return getattr(self, attr_name)
 def setter(self, value):
  setattr(self, attr_name, value)
  seq = getattr(self, seq_type)
  if (seq is not None):
   setattr(seq, attr, value)
 return property(fget=getter, fset=setter, doc=doc)

def fragcascade ( attr , seq_type , doc = '' ) : assert ( seq_type in ( 'hit' , 'query' ) ) attr_name = ( '_%s_%s' % ( seq_type , attr ) ) def getter ( self ) : return getattr ( self , attr_name ) def setter ( self , value ) : setattr ( self , attr_name , value ) seq = getattr ( self , seq_type ) if ( seq is not None ) : setattr ( seq , attr , value ) return property ( fget = getter , fset = setter , doc = doc )
returns a getter property with cascading setter .