Changelog¶
0.1.0a3 (2026-11-06)¶
Breaking changes¶
-
Widget, search and setup rework. Every project needs code changes for this upgrade. Rename the widgets, move server-side search onto the widget, add
"django.forms"toINSTALLED_APPS, and load htmx's alpine-compat extension. If you override formwork templates, copy them again from the new paths.- Rename the widgets:
SearchSelect→Select,MultiSelect→SelectMultiple,ComboBox(multiple=True)→ComboBoxMultiple,Toggle→ToggleInput,PasswordReveal→PasswordInput(the show button is on by default,reveal=Falsedrops it),InputNumber→StepperNumberInput,FileDropZone→FileDropzoneInput,ImageDropZone→ImageDropzoneInput.ComboBoxtakesChoiceLabelsuggestions in place of itsicons=anddescriptions=dicts. - Rename the Alpine components:
formworkSearchSelect→formworkSelectandformworkMultiSelect→formworkSelectMultiple.OTPInputrenders one input withlengthslots and needs no JavaScript. - Rename the templates:
django/forms/formwork.html→formwork/forms/div.htmlanddjango/forms/formwork_field.html→formwork/forms/field.html. Each widget template is named after its widget module:search_select.html→select.html,multi_select.html→select_multiple.html,input_number.html→stepper_number.html,password_reveal.html→password_input.html,drop_zone.html→file_dropzone.htmlandimage_upload.html→image_dropzone.html. The dropdown root classes areformwork-select(wassearch-select),formwork-select-multiple(wasmultiselect) andformwork-combobox(wascombobox), so update CSS that targets the old classes. FormworkRendereris aTemplatesSettingrenderer, so a template in your project overrides the formwork one. It needs"django.forms"inINSTALLED_APPSand aDjangoTemplatesbackend that finds app templates. See Installation.- A
Select,SelectMultiple,ComboBoxorComboBoxMultiplesearches on the server when it getssearch_queryset, a callable that takes the request and returns the rows.search_fieldsnames the columns to match, andsearch_decorator(an auth decorator, orNonefor a public search) is required. AFormworkFormorFormworkModelFormclass registers the search when Python creates it, and the app imports theformsmodule of every installed app at startup. The endpoint returns 20 rows, the dropdown adds a "Load more" button, and noCOUNTquery runs.search_ranked=Trueorders matches by quality on PostgreSQL (pg_trgm) and raisesImproperlyConfiguredon other databases.search_keywithsearch_paramsreuses one registered search for fields built in__init__.FormworkSearchViewis final, and an anonymous request for an unknown key redirects toLOGIN_URL. See Server-side search. - Load htmx, then
dist/ext/hx-alpine-compat.min.js, then{% formwork_js %}, then Alpine withdefer. Without alpine-compat a morph strips the state that Alpine bindings wrote into the page. Anhtmx.config.extensionswhitelist must listalpine-compatandformwork-morph, plusformwork-sectionson a page with section forms. A morph cannot open or close a<details>or<dialog>, becauseopenis inhtmx.config.morphIgnore. - The Jinja2 support is removed (
FormworkJinja2Renderer,FormworkJinja2Form,FormworkJinja2ModelForm,formwork_jinja2_environmentand thejinja2/templates). So are thesearch_choices_<field>form methods,FormworkAutoSearchViewand thewidget_typetokens, andFormworkModelChoiceField,FormworkModelMultipleChoiceFieldandFormworkModelChoiceIteratorwith theicon_from_instanceanddescription_from_instancearguments of the fields. Return aChoiceLabelfrom a plainModelChoiceField.label_from_instance()instead.ChoiceLabellives indjango_formwork.widgets.select, and you can import it fromdjango_formworkanddjango_formwork.widgets. - The new widgets are
SuffixNumberInput,DateInput,DateRangeInputwithDateRangeFieldandDateRange(indjango_formwork.fields, and importable fromdjango_formwork),Displayfor read-only values,CardRadioSelect,CardCheckboxSelectMultiple,CheckboxInput(text=...),CheckboxSelectMultiple(columns=...),ComboBoxMultipleandPatternHintMixin.TextInputtakesinput_type=,Textareatakesfloating=, andSearchInputtakesshow_spinner,show_clearandfilter_items.SelectandSelectMultipletakeallow_clearandfloating. See Widgets. section_forms()and the{% formwork_section %}tag let several forms on one page autosave their own fields of one row. Load{% formwork_sections_js %}after htmx on those pages, and give each formhx-sync="closest [data-section-forms]:queue all". See Section forms.Meta.mandatorymarks a field that a save accepts empty but a later step needs. Its label gets the red*and its widget getsaria-required, as on a required field. A string in place of a list, or a name that is not a field of the form, raisesImproperlyConfiguredwhen Python creates the form class.- Every string formwork shows goes through Django's translation functions, plurals
included. Formwork ships no catalog, so run
makemessagesin your project. The JavaScript reads its texts fromdata-*attributes and needs no JavaScript catalog. The CSS takes the[more]/[less]label of the help-text toggle from thedata-moreanddata-lessattributes of its<summary>, so an override offormwork/forms/field.htmlmust keep them. - Some widgets look different.
error_display = "auto"is the default, so a field with help text shows its error inline and a field without help text shows it in a tooltip. To keep one style, set"inline"or"tooltip"inMetaor passerror_display=.ToggleInputputs its label beside the switch, dimmed while off. Checkbox and radio groups render as a plain stacked list, each label as wide as its text. A disabled dropdown trigger is greyed out. The open panel is at most 288px high and shrinks to stay inside the viewport, and the caret points up while it is open. The dropdown search box has a magnifier and a clear button, and shows past 10 options instead of from 20. The password button shows the current state: an open eye while the password is visible.ImageDropzoneInputshows the field label and an "Upload Image" button.OTPInputis one<input>drawn as digit slots, in place of one input per digit. - Required fields keep the red
*and optional fields get no marker. The dropdowns keep their caret, compact rows and "Select…" placeholder, and the closedSelectMultiplekeeps the option icons.
- Rename the widgets:
-
django_formwork.widgets.comboboxrenamed todjango_formwork.widgets.combo_box. ImportingComboBoxfromdjango_formwork.widgetsis unaffected. The rework removes the widget-type tokens ("search_select","multiselect","combobox"),SearchRegistration.widget_type,FormworkSearchView.widget_typeand theSEARCH_SELECT_TEMPLATE,MULTISELECT_TEMPLATEandCOMBOBOX_TEMPLATEattributes, and it changes the dropdown root classes. - The 0.1.0a2 search registry is gone.
django_formwork.registry,make_key,make_choices_key,register,get_registration,get_registryandSearchRegistrationare removed. The public surface is thesearch_querysetargument of the widgets, thedjango_formwork.searchmodule andinclude("django_formwork.urls")(see the rework above). - Help text is escaped. A plain
help_textstring with HTML tags shows the tags as text. Formwork 0.1.0a2 rendered it as HTML, and Django's own templates still do. Build help text that needs markup withformat_html()ormark_safe(). A help text built from user data cannot inject markup. See Forms.
Added¶
- Editable tables.
as_row()renders aFormworkForm/FormworkModelFormas a table<tbody>, andas_rows()renders a formset as one editable<table>. Pair them with the newFormworkRowSaveMixinview mixin for per-row htmx autosave: each row posts only its own changes (keyed on the posted pk) and re-renders in place. The view needsquerysetorget_queryset(request)with the rows the user can change, and a pk outside it gets a 404. The form getsrequest.FILES, and the view takes URL kwargs. Override the markup atformwork/tables/row.htmlandformwork/tables/table.html. - Model formsets that check uniqueness in one query per check.
formwork_modelformset_factoryandformwork_inlineformset_factorybuild formsets whoseunique,unique_togetherandunique_for_datechecks against the database run once for all rows, not once per row. The errors, their messages and their placement match Django's. The forms they build are exempt fromFORMWORK_FORCE_ASYNC: in an async view, wrapformset.is_valid()andsave()insync_to_async. See Formsets. - System checks for the setup.
manage.py checkreportsdjango_formwork.E001when a form declares a server-side search but the URLconf does not includedjango_formwork.urls, anddjango_formwork.E002when"django.forms"is missing fromINSTALLED_APPS. Both mistakes used to show up only on the first search or render. - Django 6.1 support. CI runs the suite on Django 6.0 and 6.1.
- Native
<select multiple>keeps Django's rendering. A plainforms.SelectMultiplerendered through the formwork renderer stays a native<select multiple>. Usewidgets.SelectMultiplefor the dropdown. error_displayMeta option for field error rendering.FormworkFormandFormworkModelFormaccepterror_display = "auto"(default),"inline"or"tooltip"."inline"renders the error below the widget in the error color, with the icon and the toggle of the help text."tooltip"uses the DaisyUI tooltip, and"auto"picks inline when the field has help text and the tooltip otherwise. The collapsed line shows only the truncated error, and the[more]toggle expands the full error and the help text. Another value raisesImproperlyConfiguredwhen Python creates the form class. See Forms.ImageDropzoneInputshows the stored image. The widget previews the field's stored file, orpreview_urlwhen set. On an optional field its remove button postsclear_<name>, so the field cleans toFalseand a model form empties it, as withClearableFileInput. After a remove the drop area comes back, and a file picked there replaces the stored one. See Widgets.- Uniform top-level import surface. The form and formset base classes and factories,
section_forms,DateRangeFieldandDateRange,ChoiceLabel,FormworkBoundField,FormworkRenderer,FormworkSearchView,FormworkValidateView,FormworkRowSaveMixin,FormworkModeland the async mixins import fromdjango_formwork. The widgets stay indjango_formwork.widgets. A module-level__getattr__imports each name on first access, soimport django_formworkworks without configured settings or a ready app registry. Submodule imports keep working, and the docs show the top-level imports. validate_dirty_onlyskips validation of unchanged fields. Set it inMetaor pass it to the form. A field the user did not change skips its validators, itsclean_<field>()method and the model checks, and keeps its stored value. On aFormworkModelFormthe model needsget_dirty_fields(): inherit the new abstractFormworkModel, or mix infilthyfields.DirtyFieldsMixin. The package adds a dependency ondjango-filthyfields. A model form whose model lacksget_dirty_fields()raisesImproperlyConfiguredwhen Python creates the form class. See Forms.
Security¶
- No template value reaches an Alpine expression. Alpine evaluates the attribute after
the browser decodes its HTML entities, so Django's autoescaping does not protect a value
inside
x-dataor another expression. In 0.1.0a2 a field value could run as script indate_picker.html(when a form with a validation error rendered again),otp_input.htmlandinput_number.html, and a user-editable label orto_field_namevalue could do the same in theSEARCH_SELECT_TEMPLATEandCOMBOBOX_TEMPLATEsearch responses. The templates pass values through autoescapeddata-*attributes, and the search rows render through theoption_listpartial of each widget template. - Each form field gets its own search registration. In 0.1.0a2 two forms that searched
the same model with the same
search_fieldsgot one registry key, and the form that registered last won. A public form could drop thesearch_decoratorof another form or replace its scoped queryset with an unfiltered one. The key comes from the module, the class and the field name of the form, and from wheresearch_querysetandsearch_decoratorare defined, so forms that a factory builds over one model keep their own search.search_querysetmust be a callable that filters through the request it gets. A second form of the same name whosesearch_querysetcloses over other values raisesImproperlyConfigured, and so does asearch_querysetthat is not callable (the message names the field). - The search endpoint renders only formwork's own row templates. The
widgetquery parameter must beselect,select_multipleorcombo_box, and the endpoint returns 404 for any other value. Thetypeparameter and theFormworkSearchView.VALID_WIDGET_TYPESattribute are removed. FormworkValidateViewtakes avalidate_decoratorand caps the text length.validate_decoratorwraps the view, assearch_decoratordoes for the search view.MAX_TEXT_LENGTH(default50_000characters) truncates the posted text before validation, asMAX_QUERY_LENGTHdoes for a search query.
Changed¶
- Targets the stable htmx 4.0.1 release. The installation guide, the full example, and
the e2e harness load
htmx.org@4.0.1(was4.0.0-beta3). If you load htmx yourself, bump your pin; formwork's templates andformwork-core.jsneed no changes. npm still tags htmx 2 aslatest, so pin@4.0.1explicitly instead of loading an unversionedhtmx.orgURL. {% formwork_css %}is deprecated and goes away in 0.2.0. The tag linksformwork.cssas it ships, but the file is Tailwind input, so the browser applies none of its styles. Importformwork.cssfrom your Tailwind input and link the built CSS. The tag raises aDeprecationWarning.django_formwork.FormworkChoiceLabelfrom 0.1.0a2 still imports. It resolves toChoiceLabelwith aDeprecationWarningand goes away in 0.2.0. UseChoiceLabel.DatePickerandInputMaskbind to shipped Alpine.data components. If you override their widget templates, copy them again:x-dataholds only the component name. The components areformworkDatePickerandformworkInputMaskinformwork/widgets/date_picker.jsandinput_mask.js. They read their configuration from autoescapeddata-*attributes:data-value(DatePicker) anddata-mask(InputMask). Each widget class declares the module in itsMedia, so{% formwork_core_js %}with{{ form.media }}loads it. The templates drop theirescapejsfilters, because no value passes through a JavaScript expression any more.OTPInputneeds no JavaScript.StepperNumberInput,PasswordInputandValidatedTextareabind to shipped Alpine.data components. If you override their widget templates, copy them again:x-dataholds only the component name. The components areformworkStepperNumber,formworkPasswordInputandformworkValidatedTextareainformwork/widgets/stepper_number.js,password_input.jsandvalidated_textarea.js.StepperNumberInputreadsdata-minanddata-integerand takesmaxandstepfrom its<input>.ValidatedTextareareadsdata-has-errors, andPasswordInputtakes no configuration. Each widget class declares its module inMedia.FileDropzoneInputandImageDropzoneInputbind to shipped Alpine.data components. If you overridefile_dropzone.htmlorimage_dropzone.html, copy them again:x-dataholds only the component name. The components areformworkFileDropzoneandformworkImageDropzoneinformwork/widgets/file_dropzone.jsandimage_dropzone.js. They read the size limit fromdata-max-size, and the template leaves the attribute out when the widget has no limit. Each widget class declares its module inMedia. The server does not repeat the type and size checks of the browser, so validate the upload in the form. No widget template has anx-dataobject literal, andformwork.jsimports every widget module, so{% formwork_js %}and a bundler import ofdjango_formwork/static/formwork/formwork.jsload the new files.manage.py formwork installwrites the generated icon CSS into your project's static directory. In 0.1.0a2 it wrote into the installeddjango_formworkpackage, which fails on a read-only install (containers, system-wide pip, Nix). The file lands at<first STATICFILES_DIRS entry>/iconx/icons.css, or atBASE_DIR/static/iconx/icons.csswhenSTATICFILES_DIRSis not set. The new--output DIRoption sets the directory.formwork.cssdoes not import../iconx/icons.cssany more, so add@import "./static/iconx/icons.css" layer(components);(with your static directory) next to the formwork import in your Tailwind input. The layer lets thesize-*utilities override the 1em icon size. The installation guide and thefullexample show the recipe.- The installation guide lists every required step. These are
django_iconxinINSTALLED_APPS,manage.py formwork installwith its--outputoption, and a Tailwind input that importsformwork.cssand the generated icon CSS, without a second import of Tailwind or DaisyUI.formwork.cssregisters the package templates, widgets and scripts with@source, so your Tailwind input lists only your own sources. - A type checker accepts only a callable or
Noneforsearch_decoratoronSelect,SelectMultiple,ComboBoxandComboBoxMultiple(wasCallable | object). Runtime behavior is unchanged: a form with asearch_querysetwidget and nosearch_decoratorraisesImproperlyConfiguredwhen Python creates the form class. - Help text renders as one truncated line with a leading info icon. When the text
overflows, a
[more]/[less]toggle at the end of the line expands or collapses it. If you overrideformwork/forms/field.html, copy it again: the help text sits in a<details class="formwork-disclosure">, and its<summary>carries thedata-moreanddata-lesslabels.
Fixed¶
ValidatedTextareaposts only its text to the validate endpoint. htmx 4 has nohx-params, so each check while typing posted every field of the enclosing form, with any files picked in it. It poststext,field_nameanderrors_idonly.- Screen readers name the
FileDropzoneInputby its field label. The keyboard focus went to a drop area named only "Choose files", while the field label, help text and error state sat on a hidden file input. The file input takes the focus, and the drop area shows the focus ring. - Dropdowns close on any click outside.
SelectandSelectMultipleclose when a click lands anywhere outside the open panel, including the trigger of another dropdown, so opening a second dropdown closes the first. - The dropdown placeholder stays muted on focus. The "Select…" placeholder of
SelectandSelectMultiplekeeps its muted color when the trigger has focus. - Dropdown option rows invert on press, and the closed trigger keeps its border. A pressed option shows its active state, and the trigger keeps its border while the panel is open.
- Dropdown widgets keep Django's
aria-describedby.SelectandSelectMultiplerender it on the<summary>trigger andComboBoxon the combobox input, so a screen reader reads the help text and the error message that Django 6 links to the field, in addition toaria-invalid. - Screen readers announce a rejected drop. The client-side error
<p>inFileDropzoneInputandImageDropzoneInputhasrole="alert", so a screen reader reads the "too large" and "wrong type" messages. StepperNumberInputrenders empty for an unbound orNonevalue in place of0. The buttons round to the decimals of the step, so stepping0.2by0.1gives0.3, not0.30000000000000004.FormworkValidateViewemits no empty<mark>when an error span lies entirely outside the submitted text. The view drops a span that clamps to nothing.FormworkValidateViewworks behind a URL with kwargs. A validate view routed asvalidate/<field>/raised aTypeErroron every post. The URL kwargs reach the view asself.kwargs.ais_valid()runs a syncclean_<field>()orclean()that queries the database. Such a method raisedSynchronousOnlyOperation, becauseais_valid()called it inside the event loop. Sync methods run in a worker thread, and async ones are still awaited.- Your own
<details class="dropdown">keeps its behavior.formwork.csslaid a full-page click overlay over every open DaisyUIdetails.dropdownand removed the focus ring of every input inside a.dropdown-content. Both rules apply only to the formworkSelectandSelectMultiplenow. A project dropdown that relied on the overlay to close on an outside click needs its own handler, for example@click.outside="$el.open = false"with Alpine. InputMaskkeeps its text through a morph. A morph emptied the visible text of everyInputMaskwithout focus. Backspace after a literal removes the character before it, typing in the middle shifts the rest, and a+1mask no longer reads its own1as a typed digit.- Typing fast sends the last keystrokes. Text typed into the search box of a
Select, into aComboBoxor into aValidatedTextareawhile a request was pending never reached the server, so the list showed the results of an older query. The newest request now waits in a queue and runs after the pending one. - A
SelectorSelectMultipletakes the server's answer to a pick. After a pick the widget turned away every morph whose value differed from the pick, so a server that changed or reset the value was ignored. Only the answer to a request sent before the latest pick is turned away now. - Escape closes only the dropdown. Escape in an open
Select,SelectMultiple,ComboBoxorDatePickerpanel inside a<dialog>closed the dialog too. It closes the panel and puts the focus back on the trigger. Moving the focus to another control closes the panel. - Screen readers announce the picked and the highlighted option.
aria-selectedsits on the option row, and the search box of aSelectand theComboBoxinput point at the highlighted row witharia-activedescendant. ASelectwith its ownidinattrsis named by its label and its value; it pointedaria-labelledbyat an id no element had. - Labels name the
DatePickerand the floatingPasswordInputalone. Screen readers read "Due date Toggle calendar" and "Password Show password", because the toggle button sat inside the label. - A
Selectkeeps the attrs you pass.data-*,hx-*,autofocus,titleand other attrs were dropped.data-*andhx-*go on the hidden input that holds the value and fireschange; the rest go on the trigger. - A
SelectMultiplewith one malformed past-page key keeps its other selections. The bad key hid every selection past the first page. ASelectno longer posts a value that no option holds behind the placeholder, so an optional field can be saved again. - A
Selecton aModelChoiceFieldwithout a blank choice runs one query. Django's required-attribute check ran the queryset a second time. TextInput(attrs={"type": "email"})renderstype="email". The widget and subclasses that setinput_typerenderedtype="text".ValidatedTextareakeeps a leading blank line. The value lost it on every render, and autosave posted the shorter text.DatePicker(format="%d/%m/%Y")opens the calendar on the stored date. It opened on the current month with no day picked.- The
StepperNumberInputbuttons leave a readonly value alone, and a decimalminworks under a locale with a decimal comma. Ratingcan go back to unrated. The clear radio never rendered checked and stayed enabled on a disabled field. The stars getrequired,aria-invalid,aria-requiredand a caller class.SuffixNumberInputkeeps a callerstyle. The prefix padding replaced it.ComboBoxsends the typed text asqonly. The request also carried it under the field name, so a field named like a search param broke the search. A(value, label)pair in the suggestions raisesImproperlyConfigured; it rendered as a group with one suggestion per letter.
Removed¶
PhoneInputwidget. Bundling a country dial-code table (with flag emoji) and a bespoke prefix picker put application data in the framework, and it emitted a non-normalized"+1 5551234"string with no validation. Real phone handling belongs to a dedicated library such asdjango-phonenumber-field. Thefullexample has a localPhoneInputthat shows how a project builds one. The country and dial-code dataset (django_formwork/data.py) is removed with it.CountryInputwidget andcountry_choices(). The country selector was a thin wrapper overSearchSelectwith an ISO 3166-1 list, and it never validated: the choices sat on the widget, not the field, so the form rejected every submitted value. Country lists are application data. Build aforms.ChoiceField(choices=..., widget=widgets.Select())from your own list or from a package such asdjango-countries. Thefullexample shows the pattern.- The dead
AsyncModelFormMixin._apost_cleanoverride. The dirty-only model form mixin shadowed it in the MRO ofFormworkModelForm, so nothing called it. If you combineAsyncModelFormMixindirectly with a plainModelForm(unsupported), supply your own_apost_clean.
0.1.0a2 (2026-05-18)¶
Added¶
- Documentation for six widgets that already shipped in 0.1.0a1 but were missing from the reference:
CountryInput,DatePicker,InputMask,InputNumber,OTPInput,PhoneInput.
Changed¶
- Tightened support window to Python 3.14 and Django 6.0 (was Python 3.12+ / Django 5.2+ in 0.1.0a1). Pin
django-formwork==0.1.0a1if you need the wider range. formwork.jsis now an ES module —{% formwork_js %}emits<script type="module" src="...">so the file's internal imports offormwork-core.jsandwidgets/*.jsresolve. Users who referenceformwork.jsdirectly (without using the template tag) must addtype="module"to their<script>tag.- Page-global core split into
formwork-core.js— the htmx morph extension, dirty-tracking, and native-validation disabling now live in their own file, loaded via the new{% formwork_core_js %}template tag.{% formwork_js %}still works exactly as before (it importsformwork-core.jsplus the three widget modules); the split lets users on{{ form.media }}load only the core they need. - Per-widget
Media.js—SearchSelect,MultiSelect, andComboBoxnow declareclass Media: js = ...so their Alpine.data component code is included automatically via{{ form.media }}. Three loading paths now coexist:{% formwork_js %}(one-tag bundle),{% formwork_core_js %}+{{ form.media }}(per-form), orimport "django-formwork/formwork.js"from a JS bundler (django-vite, webpack, esbuild). ES module URL dedup makes the paths safely composable. - Migrated to htmx 4 — The package now targets htmx 4 (currently beta). The standalone
idiomorph-ext.min.jsdependency is gone (htmx 4 has morph in core). User-facing changes:- Form templates now use
hx-swap="outerMorph"(washx-swap="morph:outerHTML"+hx-ext="morph") - Bundled examples and the e2e harness load
htmx.org@4.0.0-beta3(was@2) formwork.jsregisters aformwork-morphhtmx extension instead of monkey-patchingIdiomorph.morph()- All
hx-on::attribute event names switch from dash to colon (config-request→config:request, etc.);hx-on::send-errorconsolidates intohx-on::error htmx:afterSwap/htmx:afterSettleevent listeners renamed tohtmx:after:swap/htmx:after:settle
- Form templates now use
- Users on htmx 2 should pin the previous django-formwork version.
Fixed¶
- Failed server-side searches no longer flash response body / stale prerender into the listbox. Two related fixes:
- htmx 4 (beta) changed its
noSwapdefault to[204, 304], so 4xx/5xx responses started getting swapped into the swap target — for our dropdowns that meant the Django debug HTML (or any error body) briefly painted in the listbox before ourhasErrorhandler hid it. Each dropdown's htmx-enabled input now cancels the swap onbefore:swapwhenevent.detail.ctx.response.status >= 400. - The
hasError = falsereset onbefore:requestmade the listbox visible again between request and a failed response, briefly re-showing the prerendered "No results" alert. That reset moved intobefore:swap(for status < 400 only), sohasErrornow staystrueacross consecutive failures and only clears when a successful swap actually happens.
- htmx 4 (beta) changed its
0.1.0a1 (2026-03-15)¶
First alpha release.
Added¶
- FormworkRenderer — Custom form renderer that applies DaisyUI-styled templates to all forms via
FORM_RENDERERsetting - FormworkForm / FormworkModelForm — Convenience base classes for per-form styling
- Form template (
formwork.html) — Renders each field inside<fieldset class="fieldset">with labels, help text, and error tooltips - Field template (
formwork_field.html) — Single source of truth for field rendering with DaisyUI tooltip errors - CSS architecture — All DaisyUI classes applied via
@applyinformwork.css(inside@layer components), not in Python or templates - Template tags —
{% formwork_css %}and{% formwork_js %}for including static assets - Custom widgets:
Toggle— Checkbox as DaisyUI toggle switchRange— HTML5 range sliderRating— Star rating with radio inputs (with optional clear button)PasswordReveal— Password input with show/hide toggle (Alpine.js)SearchSelect— Single-select dropdown with text search (static or htmx)MultiSelect— Multi-select dropdown with checkboxes (static or htmx)ComboBox— Text input with autocomplete suggestions (static or htmx, single or multiple)DataList— Text input with native<datalist>suggestionsFileDropZone— Drag-and-drop file upload with size/type validationImageDropZone— Drag-and-drop image upload with previewValidatedTextarea— Textarea with server-side validation and word highlighting
- Server-side views:
FormworkSearchView— Base view for dropdown search endpointsFormworkValidateView— Base view for textarea validation with<mark>highlighting
- htmx morph integration (
formwork.js) — Registers aformwork-morphextension that preserves Alpine.js state,<details>open state,x-text/x-htmlcontent, focused-input values, andx-for/x-ifgenerated nodes during htmx morph swaps - Django 5.2, 6.0 support; Python 3.12, 3.13, 3.14