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_)
>