[gcdebug] Only ignore weakref.WeakKeyDictionary class on Python 2
From Python 3.5, this class fails isinstance check with the following
error:
::
cls = <class 'weakref.WeakKeyDictionary'>, instance = <functools._lru_list_elem object at 0x7f4331859a48>
def __instancecheck__(cls, instance):
"""Override for isinstance(instance, cls)."""
# Inline the cache checking
> subclass = instance.__class__
E AssertionError: [<class 'AttributeError'> in gc] 'functools._lru_list_elem' object has no attribute '__class__'
/usr/lib/python3.5/abc.py:181: AssertionError
I have no clue why this happens, but it makes
cubicweb.web.test.test_views.AutomaticWebTest.test_startup_views fail on
Python 3.5. So only consider this class for Python 2.
.. _searchbar:
RQL search bar
--------------
The RQL search bar is a visual component, hidden by default, the tiny *search*
input being enough for common use cases.
An autocompletion helper is provided to help you type valid queries, both
in terms of syntax and in terms of schema validity.
.. autoclass:: cubicweb.web.views.magicsearch.RQLSuggestionsBuilder
How search is performed
+++++++++++++++++++++++
You can use the *rql search bar* to either type RQL queries, plain text queries
or standard shortcuts such as *<EntityType>* or *<EntityType> <attrname> <value>*.
Ultimately, all queries are translated to rql since it's the only
language understood on the server (data) side. To transform the user
query into RQL, CubicWeb uses the so-called *magicsearch component*,
defined in :mod:`cubicweb.web.views.magicsearch`, which in turn
delegates to a number of query preprocessor that are responsible of
interpreting the user query and generating corresponding RQL.
The code of the main processor loop is easy to understand:
.. sourcecode:: python
for proc in self.processors:
try:
return proc.process_query(uquery, req)
except (RQLSyntaxError, BadRQLQuery):
pass
The idea is simple: for each query processor, try to translate the
query. If it fails, try with the next processor, if it succeeds,
we're done and the RQL query will be executed.