How to map PostgreSQL array field in Django ORM

后端 未结 6 947
天命终不由人
天命终不由人 2020-12-10 12:33

I have an array field in my PostrgreSQL database of type text. Is there a way to map this into a Django model ?

6条回答
  •  渐次进展
    2020-12-10 13:18

    you have to subclass model.Field and write input and output methods.

    http://docs.djangoproject.com/en/dev/howto/custom-model-fields/#custom-database-types

提交回复
热议问题