I try to define a function that adds elements to a new, empty queryset and returns it. The current version of my function looks like this:
def get_colors(*args, **kwargs):
colors = Color.objects.none()
for paint in Paint.objects.all():
if paint.color and paint.color not in colors:
colors.add(paint.color)
return colors
I get the error message that says:
AttributeError: 'QuerySet' object has no attribute 'add'
Why can't I add elements to the empty queryset? What am I doing wrong?