Accepts an arbitrary number of Model classes to include in the search.
(self, *models)
| 364 | return clone |
| 365 | |
| 366 | def models(self, *models): |
| 367 | """Accepts an arbitrary number of Model classes to include in the search.""" |
| 368 | clone = self._clone() |
| 369 | |
| 370 | for model in models: |
| 371 | if ( |
| 372 | model |
| 373 | not in connections[self.query._using] |
| 374 | .get_unified_index() |
| 375 | .get_indexed_models() |
| 376 | ): |
| 377 | warnings.warn("The model %r is not registered for search." % (model,)) |
| 378 | |
| 379 | clone.query.add_model(model) |
| 380 | |
| 381 | return clone |
| 382 | |
| 383 | def result_class(self, klass): |
| 384 | """ |