docs: def get_db_prep_value(self, value):
          """
          Pickle and b64encode the object, optionally compressing it.
  
          The pickling protocol is specified explicitly (by default 2),
          rather than as -1 or HIGHEST_PROTOCOL, because we don't want the
          protocol to change over time. If it did, ``exact`` and ``in``
          lookups would likely fail, since pickle would now be generating
          a different string.
  
          """
          if value is not None and not isinstance(value, PickledObject):
              # We call force_unicode here explicitly, so that the encoded string
              # isn't rejected by the postgresql_psycopg2 backend. Alternatively,
              # we could have just registered PickledObject with the psycopg
              # marshaller (telling it to store it like it would a string), but
              # since both of these methods result in the same value being stored,
              # doing things this way is much easier.
              value = force_unicode(dbsafe_encode(value, self.compress))
          return value