How to map PostgreSQL array field in Django ORM How to map PostgreSQL array field in Django ORM postgresql postgresql

How to map PostgreSQL array field in Django ORM


You might want to look into django-dbarray on github. It adds support for postgresql array fields.

I haven't used it before, but it looks like you just need to do:

from django.db import modelimport dbarrayclass ProfilingTestRun(models.Model):    function = models.CharField(max_length=64)    runtimes = dbarray.FloatArrayField()


One of the other nice options is http://django-orm.readthedocs.org/ --- a library that adds bindings to many native postgres types.

Main drawback of django-orm is that as of today it has no working support for south.