附录数据如何看起来有效?我从php网站发送数据,并尝试了几种由DJF解析为以下格式的内容。两者都无效。
'information.appendices.file.0'
'information.appendices.file[0]'
class Information(models.Model):
type = models.CharField(max_length=10)
text = models.TextField(blank=True, null=True)
url = models.URLField(blank=True, null=True)
appendices = models.ManyToManyField('Appendix')
class Appendix(models.Model):
file = models.FileField(upload_to='information/appendices')
class AddInformationSerializer(ModelSerializer):
appendices = AppendixSerializer(many=True, required=False)