【发布时间】:2019-07-27 20:52:17
【问题描述】:
为了解决我的(有点具体的)问题,我发现我必须使用 Django ArrayField: https://docs.djangoproject.com/en/2.1/ref/contrib/postgres/fields/#arrayfield
我已在我的models.py 文件中将其定义为
Bla = ArrayField(
models.IntegerField(),
size=4
null=True
)
但是我实际上如何将信息放入其中?理想情况下,既是一个完整的 python 列表,也可以放在一个地方。
一旦它在那里,我怎样才能检索它?在 python 端,以及在.html 文件中?
PS:我不认为问题的整个背景是相关的,所以我暂时省略了,但如果有人感兴趣,我当然会提供所有必要的细节。
【问题讨论】:
标签: python arrays django postgresql