'Set fields values
data - {field_name: field_value, field_name: field_value ...}'

def set_field_values(self, data):

    for field_name in data:
        field = getattr(self, field_name, None)
        if (field is None):
            raise AttributeError('Unknown    form    field    name.')
        value = data[field_name]
        if (value is not None):
            if hasattr(field, 'text'):
                field.text = value
            elif hasattr(field, 'path'):
                field.path = value
            elif hasattr(field, 'value'):
                field.value = value
