def __init__(self, obj1, obj2, field, id1=None, id2=None, field_name=None, field_label=None, schemata=None): AsTextDiff.__init__(self, obj1, obj2, field, id1, id2, field_name, field_label, schemata) self._vocabulary = None # Tries to find a vocabulary. First we need to find an object and # the field instance. obj = obj1 if (obj1 is not None) else obj2 field_name = field_name or field field_instance = ( get_field_object(obj, field_name) if (obj and field_name) else None ) if field_instance is not None: # Binding the field to an object will construct the vocabulary # using a factory if necessary. self._vocabulary = field_instance.bind(obj).vocabulary
def __init__(self, obj1, obj2, field, id1=None, id2=None, field_name=None, field_label=None, schemata=None): AsTextDiff.__init__(self, obj1, obj2, field, id1, id2, field_name, field_label, schemata) self._vocabulary = None # Tries to find a vocabulary. First we need to find an object and # the field instance. obj = obj1 if (obj1 is not None) else obj2 field_name = field_name or field field_instance = (get_field_object(obj, field_name) if (obj and field_name) else None) if field_instance is not None: # Binding the field to an object will construct the vocabulary # using a factory if necessary. self._vocabulary = field_instance.bind(obj).vocabulary