X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Fregistry_manager.py;h=8e8eb783dbd5b569e889f530d34269904e7eb81c;hb=c7c7ed1178348445dc4ae70ea0fd905625e95421;hp=f17b3161f1bf03782d30a0beca702300dbd2c2d7;hpb=20d2fdecbb5bf1412bc8ba99f7f31bd1926d4d8e;p=sfa.git diff --git a/sfa/managers/registry_manager.py b/sfa/managers/registry_manager.py index f17b3161..8e8eb783 100644 --- a/sfa/managers/registry_manager.py +++ b/sfa/managers/registry_manager.py @@ -211,7 +211,7 @@ class RegistryManager: local_records=local_records.all() for local_record in local_records: - augment_with_sfa_builtins (local_record) + augment_with_sfa_builtins(local_record) logger.info("Resolve, (details=%s,type=%s) local_records=%s "%(details,type,local_records)) local_dicts = [ record.__dict__ for record in local_records ] @@ -235,7 +235,7 @@ class RegistryManager: # xxx somehow here calling dict(record) issues a weird error # however record.todict() seems to work fine # records.extend( [ dict(record) for record in local_records ] ) - records.extend( [ record.todict(exclude_types=[InstrumentedList]) for record in local_records ] ) + records.extend( [ record.record_to_dict(exclude_types=(InstrumentedList,)) for record in local_records ] ) if not records: raise RecordNotFound(str(hrns)) @@ -288,8 +288,15 @@ class RegistryManager: records = dbsession.query(RegRecord).filter_by(authority=hrn).all() # logger.debug("non recursive mode, found %d local records"%(len(records))) # so that sfi list can show more than plain names... - for record in records: augment_with_sfa_builtins (record) - record_dicts=[ record.todict(exclude_types=[InstrumentedList]) for record in records ] + for record in records: + # xxx mystery - again this useless statement is key here so that + # resulting records have their __dict__ field actually in line with the + # object's contents; was first observed with authorities' 'name' column + # that would be missing from result as received by client + # record.todict() is the place where __dict__ is used + print "DO NOT REMOVE ME before augment_with_sfa_builtins, record=%s"%record + augment_with_sfa_builtins(record) + record_dicts = [ record.record_to_dict(exclude_types=(InstrumentedList,)) for record in records ] return record_dicts @@ -486,7 +493,7 @@ class RegistryManager: record.email = email # update the PLC information that was specified with the record - # xxx oddly enough, without this useless statement, + # xxx mystery: oddly enough, without this useless statement, # record.__dict__ as received by the driver seems to be off # anyway the driver should receive an object # (and then extract __dict__ itself if needed)