code: def _build_models_query(self, query):
          
          registered_models_ct = self.build_models_list()
          if registered_models_ct:
              restrictions = [xapian.Query('%s%s' % (TERM_PREFIXES[DJANGO_CT], model_ct))
                              for model_ct in registered_models_ct]
              limit_query = xapian.Query(xapian.Query.OP_OR, restrictions)
  
              query = xapian.Query(xapian.Query.OP_AND, query, limit_query)
  
          return query
docs: Builds a query from `query` that filters to documents only from registered models.