Djblets 3.3 Release Notes¶
Release date: June 19, 2023
Installation¶
Djblets 3.3 is compatible with Django 3.2 and Python 3.7-3.11.
To install Djblets 3.3, run:
$ pip3 install Djblets==3.3
To learn more, see:
djblets.features¶
Added Python type hints and improved documentation for the whole module.
FeatureLevel
is now anEnum
.This should be backwards-compatible.
djblets.forms¶
Added
AmountSelectorWidget
, for taking a numeric value and a unit of measurement.This can be used to let users specify a number and select a unit from a list that represents a multiplier for that number. This can be used to accept, for example, a number of bytes, kilobytes, megabytes, etc.
djblets.integrations¶
Added Python type hints and improved documentation for the whole module.
This helps authors define new integrations and fill out attributes in a type-safe way.
Improved the error message used when trying to unregister an integration that doesn’t have an ID set.
djblets.registries¶
Improved Python type hints and documentation for errors.
Types for registry error messages can now be set to strings or lazily-localized strings (using
gettext_lazy()
.All error constants are now typed as finalized (unchangeable) strings.
RegistryErrorsDict
was added to represent these error constant to string registrations.
djblets.util¶
Added
djblets.util.symbols
, which adds useful standardized symbols:UNSET
: Represents an unset value, which is useful for functions that require differentiating between an unset value and aNone
value.
Added
djblets.util.typing
, which adds some useful type aliases:JSONDict
: A JSON-safe dictionary.JSONList
: A JSON-safe list.JSONValue
: Any JSON-safe value.KwargsDict
: A dictionary capable of storing keyword arguments.StrOrPromise
: A Unicode string or lazy-localized string from Django.StrPromise
: A lazy-localized string from Django.
Added optional Python type hint support for
BaseProperty
,AliasProperty
, andTypedProperty
.These can now be used as generics, allowing types to be specified in order to help provide type checking for attributes.
Due to limitations and inconsistencies in the existing type hint support in Python and in popular type checkers, the syntax for specifying type hints for these properties can be a bit verbose.
Please see the examples in the documentation for these classes on how to best specify type hints.
Contributors¶
Christian Hammond
David Trowbridge
Michelle Aubin