4π
β
I donβt think so you can do it like this.
QuerySet can be thought of as an extension of list but it is not the same.
If you need to return the colors you can do it like this.
def get_colors(*args, **kwargs):
colors = []
for paint in Paint.objects.all():
if paint.color and paint.color not in colors:
colors.append(paint.color)
return colors
π€Bipul Jain
Source:stackexchange.com