def get_target(cls, obj): objtype=obj.__class__.__name__ group = group_sanitizer(obj.group) label = ('.' + label_sanitizer(obj.label) if obj.label else '') target = '{objtype}.{group}{label}'.format(objtype=objtype, group=group, label=label) return (None, target) if hasattr(obj, 'values') else (target, None)
def get_target(cls, obj): objtype = obj.__class__.__name__ group = group_sanitizer(obj.group) label = ('.' + label_sanitizer(obj.label) if obj.label else '') target = '{objtype}.{group}{label}'.format(objtype=objtype, group=group, label=label) return (None, target) if hasattr(obj, 'values') else (target, None)