danni / django-postgres-composite-types

Postgres composite types support for Django
BSD 3-Clause "New" or "Revised" License
51 stars 13 forks source link

Convert types to/from database using Postgres #7

Closed mx-moth closed 8 years ago

mx-moth commented 8 years ago

Instead of relying on Django and its get_db_value/from_db_value, the type is registered more deeply with Postgres. This allows the type to be used in ArrayFields and other places where typecasting is required.

mx-moth commented 8 years ago

OK, everything has been rewritten. Same basic premise, but a new approach that uses the psycopg internals correctly. I've added a bunch of comments, so hopefully you do not have to do as much spelunking through psycopg code as I did to understand it!

I've also added tests for more complicated use-cases, which was the inspiration for this in the first place. ArrayFields with CompositeTypes, and nested CompositeTypes are covered.

danni commented 8 years ago

Add yourself to the README as an author, you've basically rewritten half of the code at this point :)

mx-moth commented 8 years ago

Some more commits pushed