parameters: (self)
docstring: Copies all the related fields from the model to the vehicle
docstring_summary: Copies all the related fields from the model to the vehicle
docstring_tokens: Copies all the related fields from the model to the vehicle
function: def _compute_model_fields(self):
          '''
          Copies all the related fields from the model to the vehicle
          '''
          model_values = dict()
          for vehicle in self.filtered('model_id'):
              if vehicle.model_id.id in model_values:
                  write_vals = model_values[vehicle.model_id.id]
              else:
                  # copy if value is truthy
                  write_vals = {MODEL_FIELDS_TO_VEHICLE[key]: vehicle.model_id[key] for key in MODEL_FIELDS_TO_VEHICLE\
                      if vehicle.model_id[key]}
                  model_values[vehicle.model_id.id] = write_vals
              vehicle.write(write_vals)
function_tokens: def _compute_model_fields ( self ) : model_values = dict ( ) for vehicle in self . filtered ( 'model_id' ) : if vehicle . model_id . id in model_values : write_vals = model_values [ vehicle . model_id . id ] else : # copy if value is truthy write_vals = { MODEL_FIELDS_TO_VEHICLE [ key ] : vehicle . model_id [ key ] for key in MODEL_FIELDS_TO_VEHICLE if vehicle . model_id [ key ] } model_values [ vehicle . model_id . id ] = write_vals vehicle . write ( write_vals )