【发布时间】:2020-09-09 19:13:39
【问题描述】:
我有自定义模型
class customModel(models.Model):
contents = models.TextField(null=True)
还有另一个带有 ArrayField 的 customModel
from django.contrib.postgres.fields import ArrayField
class customModel2(models.Model):
ArrayField(customModel()):
但它引发了错误 AttributeError: 'customModel' 对象没有属性 'set_attributes_from_name'
ArrayField(customModel) also raised similar errors.
使用自定义模型作为基本字段定义数组字段的正确方法是什么?
【问题讨论】: