Re: psycopg2 adaptation for UUIDs

ibu ☉ <ibu-qs259T/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization http://ibu.radempa.de
Message-ID <[email protected]>
Of course, str() is superfluous.
> import uuid
> UUID_ = psycopg2.extensions.new_type((2951,), "UUID[]",
>        lambda s, cursor: [uuid.UUID(i) for i in str(s[1:-1]).split(',')])
> psycopg2.extensions.register_type(UUID_)
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.