我不知道如何在models.py中检索当前的帖子。为此,我尝试了不同的方法。'QuerySet' object has no attribute 'aliments' 或者没有错误并且没有从ListAliments添加到帖子 get_object_or_404(Post, id=kwargs['id']) 这是我的models.py class ListAliments(models.Model):
= models.ForeignKey('User', on_delete=models.CASCADE)
===============
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'api.User' that has not been installed
我使用django-rest框架来构建API,使用ModelSerializer从模型返回数据。模型包含数组(使用)。models.py image_urls_norm = ArrayField(models.TextField([key]) for key in result if result[key] is not None])
model = FashionD