Return a new QuerySet instance with filter_obj added to the filters. filter_obj can be a Q object or a dictionary of keyword lookup arguments. This exists to support framework features such as 'limit_choices_to', and usually it will be more natural to use o
(self, filter_obj)
| 1681 | self._query.add_q(Q(*args, **kwargs)) |
| 1682 | |
| 1683 | def complex_filter(self, filter_obj): |
| 1684 | """ |
| 1685 | Return a new QuerySet instance with filter_obj added to the filters. |
| 1686 | |
| 1687 | filter_obj can be a Q object or a dictionary of keyword lookup |
| 1688 | arguments. |
| 1689 | |
| 1690 | This exists to support framework features such as 'limit_choices_to', |
| 1691 | and usually it will be more natural to use other methods. |
| 1692 | """ |
| 1693 | if isinstance(filter_obj, Q): |
| 1694 | clone = self._chain() |
| 1695 | clone.query.add_q(filter_obj) |
| 1696 | return clone |
| 1697 | else: |
| 1698 | return self._filter_or_exclude(False, args=(), kwargs=filter_obj) |
| 1699 | |
| 1700 | def _combinator_query(self, combinator, *other_qs, all=False): |
| 1701 | # Clone the query to inherit the select list and everything |