design_list = Design.objects.filter(tags__tag__contains='jewellery')
如果我添加一个过滤条件(如下),则返回'keyword argument repeated'
design_list = Design.objects.filter(tags__tag__contains='jewellery', tags__tag__contains='gadget')
如何添加更多条款?
答案 0 :(得分:1)
您必须使用Q
objects才能进行OR
查询:
from django.db.models import Q
Design.objects.filter(Q(tags__tag__contains = "jewellery") | Q(tags__tag__contains = "gadget"))