danni / django-postgres-composite-types

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

Composite types are not compatible with Django serializers #17

Closed georgebrock closed 6 years ago

georgebrock commented 6 years ago

Using django.core.serializers to serialize model objects that use composite types (e.g. by running python manage.py dumpdata) will result in data that cannot be deserialized (e.g. by running python manage.py loaddata).

This could probably be fixed by adding a postgres_composite_types.BaseField.value_to_string method that returned a string that was acceptable to Postgres (e.g. for a type composing two integers a string like "(1,2)" would work).

georgebrock commented 6 years ago

@timheap Thanks for the fix!