Return a copy of the current Query that's ready for another operation. The klass argument changes the type of the Query, e.g. UpdateQuery.
(self, klass=None)
| 430 | return obj |
| 431 | |
| 432 | def chain(self, klass=None): |
| 433 | """ |
| 434 | Return a copy of the current Query that's ready for another operation. |
| 435 | The klass argument changes the type of the Query, e.g. UpdateQuery. |
| 436 | """ |
| 437 | obj = self.clone() |
| 438 | if klass and obj.__class__ != klass: |
| 439 | obj.__class__ = klass |
| 440 | if not obj.filter_is_sticky: |
| 441 | obj.used_aliases = set() |
| 442 | obj.filter_is_sticky = False |
| 443 | if hasattr(obj, "_setup_query"): |
| 444 | obj._setup_query() |
| 445 | return obj |
| 446 | |
| 447 | def relabeled_clone(self, change_map): |
| 448 | clone = self.clone() |