Releases: iplweb/djangoql-iplweb
Releases · iplweb/djangoql-iplweb
0.22.1
0.22.1 (2026-06-04)
- Refine the "Did you mean" field suggestions so a clear match is no longer
diluted by unrelated fields that merely share a__suffix— e.g.
autorzy__cntnow suggests onlyautorzy__count, notutworzono__month.
Among candidates above the cutoff, only those within a small similarity margin
of the best match are kept. Newsuggest_cutoff/suggest_margin/
suggest_limitschema attributes tune the behavior. - Translations: complete and correct the catalogs for all eleven locales —
translate the messages introduced in 0.22.0 (the "Did you mean" hint, the
empty-result breakdown strings, the hidden derived-field hints) and fix a few
stale machine-merged strings (e.g. the numericnumberstype and the time
"HH:MM[:SS]"format/validation messages).
0.22.0
0.22.0 (2026-06-04)
- The "Unknown field" error now suggests close matches for likely typos:
Unknown field: autho. Did you mean: author?. Suggestions are matched
case-insensitively against every field name (including hidden derived fields,
sobook__councan point atbook__count); when nothing is close it
falls back to the fullPossible choiceslist as before. The matching is
backed by a new overridableDjangoQLSchema.suggest_field_names()hook. - Add an empty-result breakdown: when a valid DjangoQL query returns zero
rows, explain where in the query the data runs out. The new
djangoql.breakdown.explain_empty(queryset, search, schema=None, *, max_nodes=50)helper walks the validated AST for an arbitrary boolean
structure (and/or/ parentheses), runs onecount()per
sub-expression against the base queryset, and returns a tree of
{text, count, role, children}nodes flagging the killerAND
(killer_and) and deadORbranches (dead_or_branch). The admin
surfaces it automatically on empty results (lazy; disable with
djangoql_explain_empty = False, tune the cost guard with
djangoql_explain_empty_max_nodes). - Add pluggable autocomplete value fields in
djangoql.extras
(AutocompleteField+AutocompleteSchemaMixin). A field's value
suggestions can come from an arbitrary source — most usefully an existing
django-autocomplete-light endpoint — letting a user pick an object and filter
by its primary key. Suggestions are formatted"<label> [<id>]"and the
field filters<field> = pk(=,!=andinsupported), with an
icontainsfree-text fallback oversearch_fields. Three providers are
supported (priority high→low): aurl(a DAL endpoint resolved and called
in-process with the current request), aqueryset/ callable, or a
subclass override.SuggestionsAPIViewthreads the current request into the
field via a non-breakingset_requesthook.AutocompleteSchemaMixinis
also included inExtrasSchema. The change is server-side only (no
JavaScript changes), additive and non-breaking. - Breaking (derived fields): numeric relation aggregates now use dot
syntax —<rel>.<numfield>__{sum,avg,min,max}(e.g.book.rating__sum)
instead of the flat<rel>__<numfield>__sum. This reads consistently with
DjangoQL's dot navigation and stops the parent model's field list from
exploding. Relation count keeps its flat name<rel>__count. - Derived fields are hidden from autocomplete. All generated derived fields
ship withsuggested=False(relation count, date/time parts), and numeric
aggregates are synthesized on demand so they are never listed at all. They
remain fully usable in queries. - The "Unknown field" error no longer dumps the hidden derived fields into
its "Possible choices" list. It lists only the suggested fields and appends a
short hint describing the derived-field syntax with a couple of real examples
for the current model. New overridable schema hooksresolve_unknown()and
unknown_field_hint()back this behavior.