docs: def _construct_instance(cls, values):
          """
          method used to construct instances from query results
          this is where polymorphic deserialization occurs
          """
          # we're going to take the values, which is from the DB as a dict
          # and translate that into our local fields
          # the db_map is a db_field -> model field map
          items = values.items()
          field_dict = dict([(cls._db_map.get(k, k),v) for k,v in items])
  
          if cls._is_polymorphic:
              poly_key = field_dict.get(cls._polymorphic_column_name)
  
              if poly_key is None:
                  raise PolyMorphicModelException('polymorphic key was not found in values')
  
              poly_base = cls if cls._is_polymorphic_base else cls._polymorphic_base
  
              klass = poly_base._get_model_by_polymorphic_key(poly_key)
              if klass is None:
                  poly_base._discover_polymorphic_submodels()
                  klass = poly_base._get_model_by_polymorphic_key(poly_key)
                  if klass is None:
                      raise PolyMorphicModelException(
                          'unrecognized polymorphic key {} for class {}'.format(poly_key, poly_base.__name__)
                      )
  
              if not issubclass(klass, cls):
                  raise PolyMorphicModelException(
                      '{} is not a subclass of {}'.format(klass.__name__, cls.__name__)
                  )
  
              field_dict = {k: v for k, v in field_dict.items() if k in klass._columns.keys()}
  
          else:
              klass = cls
  
          instance = klass(**field_dict)
          instance._is_persisted = True
          return instance