- # (to begin with, this is just the slice x person relationship)
- def update_relations (self, subject_record, ref_record):
- type=subject_record['type']
- if type=='slice':
- self.update_relation(subject_record, 'researcher', ref_record.get('researcher'), 'user')
+ # (to begin with, this is just the slice x person (researcher) and authority x person (pi) relationships)
+ def update_driver_relations (self, subject_obj, ref_obj):
+ type=subject_obj.type
+ #for (k,v) in subject_obj.__dict__.items(): print k,'=',v
+ if type=='slice' and hasattr(ref_obj,'researcher'):
+ self.update_driver_relation(subject_obj, ref_obj.researcher, 'user', 'researcher')
+ elif type=='authority' and hasattr(ref_obj,'pi'):
+ self.update_driver_relation(subject_obj,ref_obj.pi, 'user', 'pi')