code: def load_field_values(instance, include_fields):
      
      ret = {}
      schema = instance.Schema()
      val = None
      for field in schema.fields():
          fieldname = field.getName()
          if include_fields and fieldname not in include_fields:
              continue
          try:
              val = field.get(instance)
          except AttributeError:
              # If this error is raised, make a look to the add-on content
              # expressions used to obtain their data.
              print "AttributeError:", sys.exc_info()[1]
              print "Unreachable object. Maybe the object comes from an Add-on"
              print traceback.format_exc()
  
          if val:
              field_type = field.type
              # If it a proxy field, we should know to the type of the proxied
              # field
              if field_type == 'proxy':
                  actual_field = field.get_proxy(instance)
                  field_type = actual_field.type
              if field_type == "blob" or field_type == 'file':
                  continue
              # I put the UID of all references here in *_uid.
              if field_type == 'reference':
                  if type(val) in (list, tuple):
                      ret[fieldname + "_uid"] = [v.UID() for v in val]
                      val = [to_utf8(v.Title()) for v in val]
                  else:
                      ret[fieldname + "_uid"] = val.UID()
                      val = to_utf8(val.Title())
              elif field_type == 'boolean':
                  val = True if val else False
              elif field_type == 'text':
                  val = to_utf8(val)
  
          try:
              json.dumps(val)
          except:
              val = str(val)
          ret[fieldname] = val
      return ret
docs: Load values from an AT object schema fields into a list of dictionaries