MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / add_model

Method add_model

haystack/backends/__init__.py:848–860  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers 9

modelsMethod · 0.80
test_add_modelMethod · 0.80
test_cloneMethod · 0.80
test_altered_namesMethod · 0.80

Calls 1

addMethod · 0.80

Tested by 8

test_add_modelMethod · 0.64
test_cloneMethod · 0.64
test_altered_namesMethod · 0.64