Re: flexi adaption/casting scheme - Mailing list psycopg

From Ronan Dunklau
Subject Re: flexi adaption/casting scheme
Date
Msg-id 1896027.IKvkcEHX0B@ropc
Whole thread Raw
In response to Re: flexi adaption/casting scheme  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: flexi adaption/casting scheme
List psycopg
> 1.3
> composite type => plain Python dict with key/value pairs only
> for all attributes in the composite type that have non-NULL values

It would be great to have an API to customize the class to instantiate with a
composite type.

I tried an implementation in the attached patch.

The idea would be to add an optional "ctor" argument, which would be used in
place of the namedtuple argument. Additionally, an adapter can be
automatically registered to perform the reverse conversion.

Regards,

--
Ronan Dunklau

Attachment

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: flexi adaption/casting scheme
Next
From: Tobias Oberstein
Date:
Subject: Re: flexi adaption/casting scheme