Part of djust 1.3 — read the 1.3 release notes.
Added
{% dj_radio_group %}, andlive_inputradios are aradiogroup(#3961). A lone{% dj_radio %}is announced with no group name, required state or description, and{% live_input "radio" %}rendered loose<label><input>rows.{% dj_radio_group name="plan" label="Plan" options=plans value=plan event="set_plan" required=True helper="..." error="..." %}renders a<fieldset role="radiogroup">named by its<legend>, one input per option with its own<label for>(ids<group>_<index>),aria-required, and the help and error as the group'saria-describedby/aria-invalid;field=form.planfills it from aBoundField. Both engines render the Python tag's markup (it is on the object-argument bridge).live_inputradios are wrapped in<div role="radiogroup">(legend=makes it a<fieldset>with a<legend>), and the group-levelaria_label/aria_labelledby/aria_describedby/aria_invalid/aria_requiredgo on the group instead of on every radio. Cases inTestRadioGroupandTestLiveInputRadioofpython/djust/tests/test_component_aria_v1_3_0_19.py.WizardMixincan resume stored progress (#3965).mount()always started at step 0 with nothing answered, so a reload or a reconnect that mounted the view again lost the person's place.get_wizard_initial()({step_name: {field: value}}) andget_wizard_step()(an index or a step name) are now called bymount(); the defaults return{}and0, so a wizard that overrides neither behaves as before. Values are stored as the text the browser would submit (wizard state is JSON), steps and fields the wizard does not declare are ignored with a warning, a step that does not exist starts at the first one, and every step before the one resumed counts as completed (sogo_to_stepcan return to it;next_stepandsubmit_wizardstill validate).on_step_saved(step_name, data)runs whennext_stephas validated a step, just before the wizard moves on, so "save on every step" does not need an overridden handler; a hook that raises leaves the person on the step. Not added:wizard_step_param(URL-synced step) and a hook forprev_step, whose step is not validated. Regression tests inpython/djust/tests/test_wizard_submitted_step_3964_3965.py.ModelFormMixin: cheaper live validation and a record selected from the page, without weakening ADR-017 for writes (#3967). Two opt-ins, both off by default.object_recheck = "writes": an event that cannot write reuses the record authorized earlier on the same connection instead of looking it up and authorizing it again, sodj-input="validate_field"no longer costs a query per keystroke. Only the framework's ownvalidate_fieldand the handlers named inobject_read_only_eventsqualify; every other event (submit_form,reset_form, every handler of the app's, including ones that write without saying so) is a write and gets the full check, under every setting. The record is reused only while it is unchanged since it was authorized, the route and lookup are the same and the user is the same; listed handlers are matched by function, so a subclass that redefinesvalidate_fieldor a listed handler gets the full check for it. The record's field values are compared deeply (an in-place edit of aJSONFieldcounts), and input restored from a saved session is bound to the record it was typed for (form_object_key), never to another one.get_object_lookup()(keyspk_url_kwarg/slug_url_kwarg, default the route's kwargs) selects the record from view state such as a?open=<id>parameter kept inhandle_params; the record is then authorized aftermount()andhandle_params(), with the same queryset scoping andhas_object_permission(). Withobject_optional = True, "nothing selected" isobject = Noneand no form rather than a denial; a selected record that is missing, filtered out or forbidden (or a key that is not valid,?open=abc) is still the same denial, and switching the selection starts the form from the new record's own values. Differs from the issue: read-only is declared by an allowlist (an unmarked handler is a write) rather than@event_handler(mutates=True), because the latter would turn an app's forgotten marker into a skipped authorization. Regression tests inpython/djust/tests/test_model_form_object_recheck_3967.py.- Theme classes for the form adapters, and accessible choice groups. The
classes
as_live_field/as_live/{% live_field %}use are set by slot (input,textarea,select,label,help,error,wrapper,legend,radio_group,radio_option,radio_input,radio_label, ...; the list isdjust.frameworks.FORM_CLASS_SLOTS) inLIVEVIEW_CONFIG["form_classes"], or incss_classeson an adapter subclass, without copying adapter code or a framework's whole class map.css_classeswins overform_classes, which wins over the framework's map; an unset slot keeps the framework's class. ARadioSelectrenders as<fieldset role="radiogroup">named by its<legend>, witharia-required, the group'saria-describedby/aria-invalid, and one<input type="radio" dj-change="validate_field">per choice with its own<label for>and an id<auto_id>_<index>; the hook classesdj-radio-group/dj-radio-option, plusdj-radio-group--segmentedfromgroup_variant="segmented", let a theme draw segmented buttons. ACheckboxSelectMultiplerenders as a<fieldset class="dj-checkbox-group">of checkboxes instead of a single<select>. A built-in adapter now reads its own framework's classes (framework="tailwind"gets Tailwind's even whencss_frameworkisbootstrap5). Documented indocs/ai/forms.mdand the CSS frameworks guide.
Changed
- A repeated form-field name is now a list for
dj-submithandlers, anddj-change/dj-input/dj-blur/dj-focuson a group of same-named checkboxes or a<select multiple>now send a list asvalue, under the legacy policy as well (#3959). Migration, in the order it will bite:- A
dj-changehandler on a group of same-named checkboxes (for example a per-row toggle,<input type="checkbox" name="done" dj-change="toggle_todo">on every row, or{% live_input "checkbox" %}repeated with the samehandlerand noname=) now receives the list of checked values of the group (the form, or the whole page when the boxes are in no form), not "is this box ticked". An untypedtoggle(self, value=False, **kw)sees a list, which is truthy while ANY box of the group is ticked, so unticking one of several ticked rows reads as still ticked; a handler declaringvalue: boolis rejected with a type error. Readvalueas a list, or give each box its ownnameto keep the per-box boolean. A lone checkbox is unchanged. - A
dj-submithandler that read a repeated name as one string, for example the hidden-input-plus-checkbox idiom (<input type="hidden" name="x" value="0">then<input type="checkbox" name="x" value="1">, which used to see the last value), now receives["0", "1"]when the box is ticked and"0"when it is not, so a handler declaringx: strfails only while the box is ticked. Take the last element, or give the inputs different names. - This is the owner's decision for #3959 (
FormMixin.validate_fieldmust be able to validate aMultipleChoiceField); there is no opt-out attribute. See "Fields with several values" indocs/website/guides/forms.md. Pinned bytests/js/form_events_review_3976.test.jsandpython/djust/tests/test_form_multi_value_review_3976.py.
- A
Fixed
dj-submit: the pressed submit button is lost under strict event parameters (#3958)._target, its only channel, is never generated under the strict policy (ADR-036 decision Q2), and the button's ownname=valuewas never a field. Under strict the pressed button'sname=valueis now a generated form field, as on a native post, and follows Q1 like every other generated value: it is sent only to a handler that declares that parameter or has a**catch-all, so naming a button cannot add a parameter to a closed handler (ADR-036 addendum, 2026-11-11). An unnamed or disabled button, a submit with no submitter, a name that is not an ASCII identifier starting with a letter (save-draft,_x), and a name the transports read as protocol (eventandparams, which the HTTP fallback reads as its{event, params}envelope and which re-routed the call,component_id,view_id,csrfmiddlewaretoken,constructor,prototype) send nothing, on the WebSocket and the HTTP fallback alike. Legacy handlers are unchanged (_targetstays the channel and no field is added, since a legacy closed signature rejects an unexpected parameter). Covered bytests/js/submit_submitter_3958.test.jsandtests/js/form_events_review_3976.test.js.- Multi-value form fields lose values:
dj-submitkept only the lastFormDataentry,dj-changeon a checkbox sent its checked state (#3959). A checkbox group (two or more same-named checkboxes in one form), a<select multiple>and any repeated name now reach adj-submithandler as a list in document order, the way Django'sQueryDict.getlistsees a native POST; a group or<select multiple>is a list even with one value selected or none ([]), so unticking everything replaces the server's earlier list instead of leaving it stale.dj-change(anddj-input/dj-blur/dj-focus) on one box of a group sends the list of checked values, and on a<select multiple>every selected option (it sent the box's boolean, and the first option), soFormMixin.validate_fieldvalidates aMultipleChoiceField. Reconnect form recovery replays a group as one list-valueddj-change. A lone checkbox is unchanged. The{% dj_form %}renderer now ticks / selects each member of a list value for aCheckboxSelectMultiple/SelectMultiple(it ticked nothing, so a re-render un-ticked the user's choice). Under the strict policy declarelist[str](orAny). Browser coverage intests/js/form_multi_value_3959.test.js,tests/js/form_recovery_multi_value_3959.test.jsandtests/js/form_events_review_3976.test.js; the server half is pinned inpython/djust/tests/test_form_multi_value_3959.pyand, for the renderer in both engines,python/djust/tests/test_form_multi_value_review_3976.py. dj-disable-withrestored a button's old text over the text the server had just rendered (#3963). The restore pass ran after the response's patches, so a button the same response re-labelled in place (a "Next" button becoming "Finish") showed its pre-submit text again, and a button the response rendereddisabledwas re-enabled. The restore now runs before the patches, so they apply to the server's baseline and have the last word, and it re-enables only a button the submit itself disabled (a sibling submit button that was alreadydisabledstays disabled). Covered bytests/js/disable_with_server_text_3963.test.jsandtests/js/form_events_review_3976.test.js.WizardMixin.next_stepignored the step form adj-submitposted, andvalidate_fielddid not validate (#3964). A step rendered as<form dj-submit="next_step">was validated againstwizard_step_dataonly, so unless every field had also sent avalidate_fieldevent the step failed as empty (or passed on stale values).next_stepnow merges the fields the CURRENT step's form declares (and nothing else: not the CSRF token, not another step's fields) into the step's data before validating, through the samemax_form_fields/max_form_data_size/max_form_membersbounds as every other client-named key (a post past them is refused whole);submit_wizarddoes the same for the last step.validate_fieldnow also cleans that one field (field.clean()and the form'sclean_<name>(), asFormMixin.validate_fielddoes) and puts the failure inwizard_step_errors[step][field]while the person types. The wizard guide now says thatwizard_rendered_fields = ()skips the per-renderfield_htmlwork for a template that writes its own inputs. Regression tests inpython/djust/tests/test_wizard_submitted_step_3964_3965.py.FormSetHelpersMixin.add_row/remove_row(and the module-level helpers) droppedinstance,querysetand every other formset argument (#3966). They rebuilt the formset asformset_cls(data, prefix=prefix): an inline formset lost its parent after one "Add row" (saving then created items with no order) and a model formset fell back to the model's whole table, where a posted row id outside the view's queryset would be saved.add_row()/remove_row()now take**formset_kwargsand pass them through, and the mixin getsget_formset_kwargs(name)(default{};dataandprefixare refused) which both handlers call andmount()can use to build the same formset. When the bound data has no management form yet (a view that starts with_formset_data = {}) and formset kwargs are given, the formset those kwargs build is the starting point, so the rows it already shows are kept; passing the kwargs alone would still have shown only the new row. With no formset kwargs nothing changes. Regression tests inpython/djust/tests/test_formset_kwargs_3966.py.- Flash messages are one live region each, not
role="alert"insiderole="status"(#3968).{% dj_flash %}rendered its container asrole="status" aria-live="polite"and the client appended each message asrole="alert", nesting live regions, which leaves the announcement (twice, or at the wrong urgency) to each screen reader. The container (both renderers) no longer has a role oraria-live;showFlashgivesinfo,successand any other levelrole="status"andwarning/errorrole="alert". If you wrote your own#dj-flash-container, drop its live role too. Not verified with a screen reader. Cases in theflash live regions (#3968)block oftests/js/flash.test.jsandTestContainerIsNotALiveRegionofpython/tests/test_flash_tag_handler.py. {% progress %}draws under a strict CSP and exposes a progress value (#3969). The fill wasstyle="width:N%", which astyle-srcwithout'unsafe-inline'refuses, so the bar rendered empty. The width is now a class,dj-progress-w-0todj-progress-w-100(incomponents.css), on the Django tag, the native handler anddjust.components.Progress(which rounds to a whole percent;aria-valuenowkeeps the exact value). The native handler's track also gainsrole="progressbar",aria-valuenow/-min/-maxand anaria-label, as the Python tag's has (named by itslabel=when there is one; no renderer invents a name for an unlabelled bar).djust.components.ui.Progress(the Bootstrap / Tailwind one) is unchanged. Verified in a browser understyle-src 'self'. Cases inTestProgressofpython/djust/tests/test_component_aria_v1_3_0_19.py.{% stepper %}steps are keyboard-operable buttons in an ordered list (#3970). Under the Rust engine each step was a<div dj-click>: not focusable, no role, the current step unmarked, "completed" only a CSS class. All three renderers (the Django tag, the native handler andStepper) now render<ol class="stepper">of<li class="stepper-step">, each holding a<button type="button">; the current step isaria-current="step"and a completed step that is not current adds a visually hidden "(completed)". If you restyle.stepper-stepas a button, move those rules to.stepper-step-button(the<li>is now the flex item). Cases inTestStepperofpython/djust/tests/test_component_aria_v1_3_0_19.py.{% status_indicator %}is no longer a live region on every instance (#3971). It renderedrole="status", so a page with one indicator per table row had dozens of polite live regions, each announced when its text changed. A label that is part of the page is not a status message (WCAG 4.1.3): the indicator is now a plain<span>, under both engines.live=True(also onStatusIndicator) opts the one indicator that updates in place back in. Cases inTestStatusIndicatorofpython/djust/tests/test_component_aria_v1_3_0_19.py.djust.Y005no longer flags an<svg>orrole="img"inside anaria-hidden="true"ancestor (#3973).aria-hidden="true"removes the whole subtree from the accessibility tree, so a graphic inside a hidden wrapper needs no name; the check only looked at the element's own attributes. An unhidden unnamed<svg>,aria-hidden="false"on the wrapper, a sibling after the wrapper closes, a self-closing or void "wrapper" and a wrapper that never closes are still reported. Cases inTestY005AriaHiddenAncestor3973ofpython/djust/tests/test_accessibility_checks.py.- Form adapter fields link their help text and errors to the control. Every
adapter gives the help text the id
<auto_id>-helpand the errors<auto_id>-error(auto_idisid_<name>unless passed), lists the rendered ones in the control'saria-describedby(after any the widget sets), marks a field with errorsaria-invalid="true", and hides the required*from assistive technology (the control is alreadyrequired). An optionalChoiceFieldwhose choices already include a blank option no longer gets a second empty<option>, grouped choices render as<optgroup>, aBooleanFieldno longer renders two labels, and radio ids no longer contain the choice value (a value with a space made an invalid id). Pinned inpython/tests/test_form_adapter_a11y.py. toggle_groupandratingno longer submit the form they sit in, and can post their value. Their buttons had notype, so inside a<form>each click was a submit. Every renderer (the template tag, the Rust engine's inline handler and theToggleGroup/Ratingcomponent classes) now writes<button type="button">.{% toggle_group ... form_field=True %}adds hidden inputs that post the selected value(s) undername, and{% rating ... name="score" %}posts the current rating; both are opt-in, so a submit handler that does not take the field is unchanged.{% dj_radio %}builds its id from<name>_<value>with characters other than letters, digits,_and-replaced by-(a value with a space made an invalid id), and takes an explicitid=. Pinned inpython/djust/tests/test_component_form_buttons.py.
Security
toggle_groupno longer lets a marked-safe value out of an attribute.name(data-name),event(dj-click),size(the class suffix) andmode(data-mode) were written withconditional_escape, which keeps a value marked safe, so amark_safestring closed the attribute and injected markup; the native handler also did this for each option'sdata-value, and for all five when a typed argument or a direct call handed it the real value. All five now go throughattr_text, in the Django tag and the native handler. The change also restores the safe-markup audit baseline thatmainfailed (ToggleGroupHandler.renderwas unaudited after #3962); pinned inpython/djust/tests/test_component_form_buttons.py.rustix1.1.4 to 1.1.6 (RUSTSEC-2026-0486, #3985). An unsound-class advisory (xattr functions marking unwritten bytes as initialized for a zero-length buffer) that the repository's audit policy denies.rustixis reached only as a dev-dependency (tempfileviaproptestindjust_vdomanddjust_templates), so it is not in the shipped extension.bincode2.0.1 (RUSTSEC-2025-0141, unmaintained) stays an allowed warning under.cargo/audit.toml.