Django: Filter a Queryset made of unions not working

前端 未结 3 1508
一向
一向 2021-02-13 14:53

I defined 3 models related with M2M relationsships

class Suite(models.Model):
    name = models.CharField(max_length=250)
    title = models.CharField(max_length         


        
3条回答
  •  伪装坚强ぢ
    2021-02-13 15:23

    There is a simple solution. Just use

    self.queryset = self.queryset | 
    

    instead of

    self.queryset = self.queryset.union()
    

    Worked for me. I hope this is understandable. After this you will be able to use filter.

提交回复
热议问题