I have an array field in my PostrgreSQL database of type text. Is there a way to map this into a Django model ?
Tell me more
×
Stack Overflow is a question and answer site for
professional and enthusiast programmers. It's 100% free, no registration required.
|
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:
|
|||
|
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 |
||||
|
you have to subclass http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#custom-database-types |
|||
|
djorm-ext-pgarray also offer queries http://www.niwi.be/2012/10/07/postgresql-array-fields-with-django/ |
|||||
|