How to map PostgreSQL array field in Django ORM

后端 未结 6 946
天命终不由人
天命终不由人 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:22

    Native support for PostgreSQL specific model fields is coming soon to Django (in the django.contrib.postgres.fields module):

    • https://docs.djangoproject.com/en/dev/ref/contrib/postgres/fields/#arrayfield
    • https://github.com/django/django/pull/2485 : The corresponding pull request

提交回复
热议问题