code: def get_db_prep_value(self, value, connection, prepared=False):
          
          if not prepared:
              value = self.get_prep_value(value)
          return value.state.name
docs: Convert a value to DB storage.
  
          Returns the state name.