I have a model that contains two ManyToMany fields, and I have successfully created entries containing these fields. When I create a queryset, the data from here isn’t included. How can I access that data?
Queryset code:
example_list = Example.objects.values_list().order_by('-date_submitted')
Models.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')
I’ve solved this by use of the filter method, as follows: