original_docstring: Converts a DB model object to a dictionary suitable for Elasticsearch.
docstring: Converts a DB model object to a dictionary suitable for Elasticsearch.
docstring_tokens: Converts a DB model object to a dictionary suitable for Elasticsearch .
code: def db_object_to_dict(cls, db_object):
          """Converts a DB model object to a dictionary suitable for Elasticsearch."""
          mapped_values = (
              (col, fn, getattr(db_object, col)) for col, fn in cls.MAPPINGS.items()
          )
          fields = get_model_non_mapped_field_names(cls)
  
          result = {
              **{col: fn(val) if val is not None else None for col, fn, val in mapped_values},
              **{col: fn(db_object) for col, fn in cls.COMPUTED_MAPPINGS.items()},
              **{field: getattr(db_object, field) for field in fields},
              '_document_type': cls.get_app_name(),
          }
  
          return result
code_tokens: def db_object_to_dict ( cls , db_object ) : mapped_values = ( ( col , fn , getattr ( db_object , col ) ) for col , fn in cls . MAPPINGS . items ( ) ) fields = get_model_non_mapped_field_names ( cls ) result = { ** { col : fn ( val ) if val is not None else None for col , fn , val in mapped_values } , ** { col : fn ( db_object ) for col , fn in cls . COMPUTED_MAPPINGS . items ( ) } , ** { field : getattr ( db_object , field ) for field in fields } , '_document_type' : cls . get_app_name ( ) , } return result
short_docstring: Converts a DB model object to a dictionary suitable for Elasticsearch.
short_docstring_tokens: Converts a DB model object to a dictionary suitable for Elasticsearch .
comment: """Converts a DB model object to a dictionary suitable for Elasticsearch."""