djangordf.query¶
Q objects compose filter expressions with &, |, and ~. Pass
them as positional arguments to RDFManager.filter alongside the
usual kwargs.
Q objects for composing filter expressions with &, | and ~.
A Q instance carries a connector (AND or OR), a negation
flag, and a list of children. Children are either other Q
subtrees or (key, value) leaves built from kwargs at construction
time. The operator dunders return new Q instances; same-connector
chains are flattened so the resulting tree stays shallow.
- class djangordf.query.Q(*args, _connector='AND', _negated=False, **kwargs)[source]¶
Bases:
objectComposable filter expression for
RDFManager.filter().- AND = 'AND'¶
- OR = 'OR'¶
- property is_leaf_only: bool¶
True when every child is a
(key, value)leaf — useful for the byte-identical fast path in the flat filter case.