Restricts the query requiring matches in the given model. This builds upon previous additions, so you can limit to multiple models by chaining this method several times.
(self, model)
| 846 | self.order_by = [] |
| 847 | |
| 848 | def add_model(self, model): |
| 849 | """ |
| 850 | Restricts the query requiring matches in the given model. |
| 851 | |
| 852 | This builds upon previous additions, so you can limit to multiple models |
| 853 | by chaining this method several times. |
| 854 | """ |
| 855 | if not isinstance(model, ModelBase): |
| 856 | raise AttributeError( |
| 857 | "The model being added to the query must derive from Model." |
| 858 | ) |
| 859 | |
| 860 | self.models.add(model) |
| 861 | |
| 862 | def set_limits(self, low=None, high=None): |
| 863 | """Restricts the query by altering either the start, end or both offsets.""" |