(doc_uuid)
Get the hash for a UUID from PostgreSQL

        This is used to ensure the python version is consistent with what's
        being used by PL/Proxy
Get the hash for a UUID from PostgreSQL
Get the hash for a UUID from PostgreSQL
def hash_doc_uuid_sql_for_testing(doc_uuid):
        """Get the hash for a UUID from PostgreSQL

        This is used to ensure the python version is consistent with what's
        being used by PL/Proxy
        """
        assert settings.USE_PARTITIONED_DATABASE

        if not isinstance(doc_uuid, UUID):
            raise ValueError("Expected an instance of UUID")

        query = "SELECT hash_string(CAST(%s AS bytea), 'siphash24') AS hash"
        with XFormInstanceSQL.get_plproxy_cursor() as cursor:
            doc_uuid_before_cast = '\\x%s' % doc_uuid.hex
            cursor.execute(query, [doc_uuid_before_cast])
            return fetchone_as_namedtuple(cursor).hash
def hash_doc_uuid_sql_for_testing ( doc_uuid ) : assert settings . USE_PARTITIONED_DATABASE if not isinstance ( doc_uuid , UUID ) : raise ValueError ( "Expected an instance of UUID" ) query = "SELECT hash_string(CAST(%s AS bytea), 'siphash24') AS hash" with XFormInstanceSQL . get_plproxy_cursor ( ) as cursor : doc_uuid_before_cast = '\\x%s' % doc_uuid . hex cursor . execute ( query , [ doc_uuid_before_cast ] ) return fetchone_as_namedtuple ( cursor ) . hash