simple way for QuerySet union and subtraction in django?

后端 未结 5 794
醉话见心
醉话见心 2021-02-07 02:15

Consider two QuerySet objects of the same class. Is there a simple way to unify them into a single QuerySet by calculating the union? Also, is there a simple way to subtract the

5条回答
  •  既然无缘
    2021-02-07 02:36

    I think for operations as this you need to evalute them. So you can call list() on them and work on them with the common python list operations!

提交回复
热议问题