You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL fields. The fields of django.contrib.postgres now get a
widget and a format by default. An ArrayField is edited as rows
(ListWidget) that take numbers, dates or times as its base field does
and stop at its size, and shows its items as pills; an ArrayField
whose base field has choices is a multi-select of them. An HStoreField
is edited as key and value rows (KeyValueWidget) and shows as
"key: value" pills (new KeyValueFormat). IntegerRangeField, BigIntegerRangeField and DecimalRangeField are edited with the new RangeWidget, a from and a to box where either may stay empty for an
open end, and show as 1–5, ≥ 18 or ≤ 9 (new RangeFormat). An integer
range includes its "to" number (1 to 5 is saved as [1,6)); a decimal
range keeps its end exclusive. Exports show ranges as text, and the
export for import writes them so they import again. A DateRangeField
gets the date range picker (DateRangeWidget, DateRangeFormat) with
an inclusive last day, and a DateTimeRangeField gets RangeWidget
with two date and time pickers.
Month fields.content_studio.fields.MonthField stores a month of a
year, such as an expiry date or the month an issue came out. It is a DateField that always saves the first day of the month, so sorting,
date filters and lookups such as __year keep working; text may name
the month alone ("2026-03"). Its widget, MonthWidget(min_date=None, max_date=None), shows the month in full and opens a grid of months
with a year stepper; the year opens a grid of twelve years, and This
month and Clear sit below. On a plain DateField the widget saves the
first day of the picked month. The list page shows months as Mar 2026
(MonthFormat(style="long" | "short" | "numeric"), "long" in
read-only fields), filters them on a From and To month, and edits them
in place with the same grid.
Custom widgets and formats. Subclass content_studio.widgets.CustomWidget or content_studio.formats.CustomFormat and set component and js to
edit or show a field with a React component of your own, in a JavaScript
module in your static files. The admin loads the module the first time a
page shows the widget or format. The module imports react and the
admin's @content-studio/admin (registerWidget, registerFormat, useLanguage) and @content-studio/ui (inputs, buttons, selects,
checkboxes, switches, badges, tooltips, popovers, dialogs, a spinner and
toasts) by name, so the component uses the admin's own React and looks
like the built-ins. Widgets get the same props as the built-ins, plus setError(message), which blocks Save while the input can't be saved. get_options() reaches the component as options. A script that fails
to load or a component that throws shows the value as read-only text, and
the developer tools report it. Type declarations ship in content_studio/static/content_studio/runtime/content-studio.d.ts. The
new check content_studio.E069 reports the base class used directly, a
subclass without component or js, a script no static files finder
has, and one name for two scripts.
DateFormat, DateTimeFormat and MonthFormat take highlight_past
and highlight_future, each a content_studio.formats.Highlight(color, label=None): a date, moment or month in the past or the future shows in
one of the BadgeFormat colors, with the label on hover and for screen
readers, such as highlight_past=Highlight("gray", _("Published")) and highlight_future=Highlight("blue", _("Scheduled")) for a publish date.
Today, or the current month, is neither past nor future.
Date ranges.DateRangeWidget(end_field=None, presets=None, min_date=None, max_date=None) picks a range of days in one control:
two months side by side, the first click picks the first day and the
second the last, with presets beside them (Today, Tomorrow, This week,
Next week, This month and Next month by default; presets picks others
or [] hides them). On the first day's DateField with end_field it
fills both fields; an optional end field saves a first day alone as an
open range, and saving refuses a last day before the first. Without end_field it edits one {"lower", "upper"} value, such as a Postgres DateRangeField's. DateRangeFormat(end_field=None, style="medium", show_length=False) shows a range the short way (Dec 3 – 9, 2026; From
Dec 3, 2026 for an open end), and the column of a two-field range shows
it by itself. Its highlight_past, highlight_future and highlight_current take a Highlight for a range that ended before
today, starts after today or includes today. content_studio.filters.DateRangeFilter("starts_on", "ends_on") filters the list on the days a range overlaps, where an
empty end counts as still running. All date filters now offer presets
(Today, Last 7 days, Last 30 days, This month, Last month, Next 7 days,
Next 30 days and This year) and pick the range on two months. The new
check content_studio.E070 reports a range widget, format or filter
that cannot work.
Bug fixes
MapWidget(lng_field=...) now saves the longitude field: the edit
page sent it, but the field was not among the ones a save writes.