我有一个包含两个 ManyToMany 字段的模型,并且我已成功创建包含这些字段的条目。当我创建一个查询集时,这里的数据不包括在内。我怎样才能访问这些数据?
查询集代码:
example_list = Example.objects.values_list().order_by('-date_submitted')
模型.py
class Example(models.Model):
example_id = models.ForeignKey(User)
date_submitted = models.DateTimeField()
title = models.CharField(max_length=70)
description = models.TextField()
file = models.FileField(upload_to='files')
photo = models.FileField(upload_to='design_photos')
materials = models.ManyToManyField('Materials')
tags = models.ManyToManyField('Tags')