Skip to content

Releases: iplweb/djangoql-iplweb

0.22.1

04 Jun 07:00

Choose a tag to compare

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__cnt now suggests only autorzy__count, not utworzono__month.
    Among candidates above the cutoff, only those within a small similarity margin
    of the best match are kept. New suggest_cutoff / suggest_margin /
    suggest_limit schema 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 numeric numbers type and the time
    "HH:MM[:SS]" format/validation messages).

0.22.0

04 Jun 06:32

Choose a tag to compare

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,
    so book__coun can point at book__count); when nothing is close it
    falls back to the full Possible choices list as before. The matching is
    backed by a new overridable DjangoQLSchema.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 one count() per
    sub-expression against the base queryset, and returns a tree of
    {text, count, role, children} nodes flagging the killer AND
    (killer_and) and dead OR branches (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 (=, != and in supported), with an
    icontains free-text fallback over search_fields. Three providers are
    supported (priority high→low): a url (a DAL endpoint resolved and called
    in-process with the current request), a queryset / callable, or a
    subclass override. SuggestionsAPIView threads the current request into the
    field via a non-breaking set_request hook. AutocompleteSchemaMixin is
    also included in ExtrasSchema. 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 with suggested=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 hooks resolve_unknown() and
    unknown_field_hint() back this behavior.