This is a pre-release. djust 0.3.2 has shipped since: read the djust 0.3.2 release notes.
Before you upgrade, read Deprecated, Removed below.
Fixed
- Form data lost on
dj-submit— Client-only properties (_targetElement,_optimisticUpdateId,_skipLoading,_djTargetSelector) are now stripped from event params before serialization. Previously,HTMLFormElementreferences in params corrupted the JSON payload, overwriting form field data with the element's indexed children. (#308) @change→dj-changein form adapters — All three framework adapters (Bootstrap 5, Tailwind, Plain) rendered@change="validate_field"instead ofdj-change="validate_field", causing real-time field validation to silently fail. (#310)EmailFieldrendered astype="text"—_get_field_type()checkedCharFieldbeforeEmailField(which inherits fromCharField), so email fields never gottype="email". Reordered the isinstance checks. (#310)
Security
- XSS in
FormMixin.render_field()— Removedrender_field(),_render_field_widget(), and_attrs_to_string()fromFormMixin. These methods used f-strings with no escaping to build HTML, allowing stored XSS via form field values. Useas_live()/as_live_field()(which delegate to framework adapters with properescape()) instead. (#310) - Textarea content not escaped in adapters —
_render_input()passed raw textarea values to_build_tag()content withoutescape(). Addedescape(str(value))for textarea content. (#310)
Changed
- Framework adapters deduplicated — Created
BaseAdapterwith all shared rendering logic.Bootstrap5Adapter,TailwindAdapter, andPlainAdapterreduced from ~200 lines each to ~10 lines of class attributes.frameworks.pyreduced from ~657 to ~349 lines. (#310) _model_instancesupport for ModelForm editing —FormMixin.mount()now reads field values from_model_instanceif set and the form is aModelForm._create_form()passesinstance=to the form constructor. (#310)
Deprecated
LiveViewForm— EmitsDeprecationWarningon subclass. Adds no functionality overdjango.forms.Form. Will be removed in 0.4. (#310)