def convert_instrument(obj): """ :type obj: :class:`sir.schema.modelext.CustomInstrument` """ instrument = models.instrument(id=obj.gid, name=obj.name) if obj.comment: instrument.set_disambiguation(obj.comment) if obj.description: instrument.set_description(obj.description) if obj.type is not None: instrument.set_type(obj.type.name) return instrument
def convert_instrument(obj): """ :type obj: :class:`sir.schema.modelext.CustomInstrument` """ instrument = models.instrument(id=obj.gid, name=obj.name) if obj.comment: instrument.set_disambiguation(obj.comment) if obj.description: instrument.set_description(obj.description) if obj.type is not None: instrument.set_type(obj.type.name) if len(obj.aliases) > 0: instrument.set_alias_list(convert_alias_list(obj.aliases)) return instrument
def convert_instrument(obj): """ :type obj: :class:`sir.schema.modelext.CustomInstrument` """ instrument = models.instrument(id=obj.gid, name=obj.name) if obj.comment: instrument.set_disambiguation(obj.comment) if obj.description: instrument.set_description(obj.description) if obj.type is not None: instrument.set_type(obj.type.name) instrument.set_type_id(obj.type.gid) if len(obj.aliases) > 0: instrument.set_alias_list(convert_alias_list(obj.aliases)) if len(obj.tags) > 0: instrument.set_tag_list(convert_tag_list(obj.tags)) return instrument