Djblets 2.0 Release Notes¶
Release date: December 16, 2020
Packaging/Compatibility¶
Increased Python support to 2.7 and 3.6-3.9.
This is the last version series to support Python 2.7.
Increased Django support to 1.6 and 1.11.
This is the last version series to support any Django 1.x releases.
Added a dependency on Pillow and removed support for PIL.
PIL is a legacy image library that we’ve maintained compatibility with through pillowfight. We’re finally dropping PIL and moving entirely to Pillow.
If you hit any issues, you may need to manually uninstall PIL.
Added a dependency on python-dateutil 2.7 or higher.
djblets.markdownnow requires Markdown 3.x.djblets.extensionsnow requires django-evolution 2.1 or higher for extension database support.
LessCSS/JavaScript Components¶
ConfigForms¶
Added ARIA attributes to improve accessibility.
Switched all ConfigForms classes to our modern CSS Component naming scheme.
These were first introduced in Djblets 1.0. The modern scheme uses
djblets-c-config-forms-*prefixes for all CSS classes, and a-is-*or-has-*form for modifier CSS classes.This is now used all throughout our codebase, in both CSS and JavaScript. Consuming applications may need to make changes.
Added a
.djblets-o-spinnerCSS Component for showing a spinner.This replaces the Font Awesome
fa-spinner. It’s less wobbly, cleaner, and supports light/dark themes.LessCSS-based consumers can set the theme by calling
#djblets-ns-ui.spinners.set-themewithdarkorlightwithin a spinner selector rule.Added a
.djblets-c-config-forms-list-actionsCSS component for adding a list of actions above a list.Added support for item states in list items.
.djblets-c-config-forms-list__itemnow supports CSS modifier classes:.djblets-c-config-forms-list__item.-is-disabledand.djblets-c-config-forms-list__item.-has-error. These affect the presentation of the item, using icons and colors.New states can be added using
#djblets-ns-config-forms.list.add-item-state.Djblets.Config.ListItemView()will manage these based on theitemStateattribute on theDjblets.Config.ListItem().Added support for multi-line content in list items.
List items that contain multiple lines of content (such as multiple paragraphs) should use the new
.djblets-c-config-forms-list__item.-is-multilineCSS modifier class or a.djblets-c-config-forms-list.-all-items-are-multilineon the parent.djblets-c-config-forms-list. These will ensure padding and actions are correct.Djblets.Config.ListItemView()actions can now return aPromise()for asynchronous tasks.This will cause the button to show a spinner until the action is complete or has failed.
Added many new ConfigForms variables and macros in
#djblets-ns-config-forms.
Modal Boxes¶
Added a new formal stylesheet for modal boxes.
This is available in the
djblets-uiPipeline bundle, and replaces the old styles that were only available when using thedjblets-extensionsbundle.Definitions are in
djblets/css/ui/modalboxes.less.Added ARIA attributes to improve accessibility.
djblets.auth¶
Fixed a database transaction error in
RegistrationFormthat could occur when attempting to create a user with a conflicting username.
djblets.avatars¶
Removed the deprecated
AvatarServiceRegistry.enabled_servicessetter property.Callers must update to use
AvatarServiceRegistry.set_enabled_services()instead.
djblets.configforms¶
Removed the deprecated
ConfigPageForm.profileproperty.
djblets.datagrid¶
All column sorting links are now marked as
nofollow.This will hint to search engine bots that they shouldn’t attempt to load all the various sorting variants of the URL.
Fixed some display issues involving tiny gaps between headers and bodies, which mostly affected high-DPI displays.
Removed a gap on the right-hand side of the datagrid header when a scrollbar is visible.
Removed the deprecated
paginator()template tag.
djblets.db¶
Fixed a rare infinite recursion issue in
CounterField.Patch by Beth Rennie.
Removed the deprecated
encoderargument in theJSONFieldconstructor, in favor ofencoder_clsandencoder_kwargs.
djblets.extensions¶
Added a new and improved UI for managing extensions.
This is a complete design refresh, bringing it in line with the Integrations UI. The new design makes use of the Djblets ConfigForms CSS styles, making it easier to embed in any page, not just the Django admin UI.
The new layout does a better job of presenting the enabled and available extensions, and bringing attention to the buttons for managing the extension state and configuring the extension.
It’s also been made more accessible, helping people manage the list when using screen readers.
Consumers can also set
DJBLETS_EXTENSIONS_BROWSE_URLin their project’ssettings.pyto a URL, which will enable a More Extensions button for getting additional extensions.Database migrations for extensions now support both evolutions (through Django Evolution) and Django’s migrations.
Evolutions are also no longer applied to multiple extensions or Django apps at a time.
Shortcuts for extension-provided API resources are now added to the root API’s URI templates list.
Patch by Maram El-Salamouny.
Fixed some extension state management issues when an extension broke in the middle of initializing.
Removed the deprecated
SettingsForm.siteconfigattribute, in favor ofSettingsForm.instance.Removed the deprecated support for calling
ExtensionHook.shutdown(), in favor ofExtensionHook.disable_hook().ExtensionHook.shutdown()is now specifically intended for hooks to perform their own shutdown logic.Removed the deprecated
'djblets.extensions.loaders.load_template_source'inTEMPLATE_LOADERS.This was used to load templates from extensions. Consumers must now add
djblets.extensions.loaders.LoaderinTEMPLATE’sloaderslist.Removed the deprecated support for passing an
pkg_resources.EntryPointtoExtensionInfo.Callers should call
ExtensionInfo.create_from_entrypoint()if they need to pass one.
djblets.forms¶
Added
RelatedObjectWidget, which can be extended to provide a clean, mobile-friendly UI for managing a list of related objects in a form.This is intended as a replacement for Django’s built-in filtered selection fields.
Patch by Storm Kaefer.
djblets.gravatars¶
Removed the deprecated
requestargument inget_gravatar_url_for_email()andget_gravatar_url().
djblets.http¶
Added
AbsoluteURLRedirectMiddleware, which turns all relative URL redirects to absolute.
djblets.integrations¶
Removed the deprecated
Integration.render_config_status().Removed the deprecated
{% render_integration_config_status %}template tag.The
integrationstemplate tag library is now deprecated.
djblets.log¶
Fixed a crash when trying to log a message with a
HttpRequestthat was missing attributes expected inLOGGING_REQUEST_FORMAT.The “Reloading logging settings” message is now logged as debug instead of info.
djblets.registries¶
Added
djblets.registries.importer.lazy_import_registry(), which can be used to create a registry instance at a module level only when it’s first accessed.This can help with providing registries at the base of a Django app without causing loading problems in modern versions of Django.
djblets.testing¶
Added
TestCase.assertWarns(), for asserting that a warning was emitted by a call.Added
TestCase.assertNoWawrnings(), for asserting that no warning is emitted by a call.TestModelsLoaderMixinis now much faster, requires less database work, and is compatible with Django Evolution 2.0+.
djblets.urls¶
Removed the deprecated support for an initial view path string prefix in
never_cache_patterns().
djblets.util¶
Added a special
AliasPropertyclass for creating an alias to another attribute.This can optionally emit a deprecation warning on access, making it useful when renaming attributes and retaining backwards-compatibility.
Added a special
TypedPropertyclass for type-specific properties.This will do the work of checking that any values set are of a list of supported types.
Added a
{% querystring %}template tag for adding, removing, or updating URL query strings.This deprecates
{% querystring_with %}.Patch by Mandeep Singh.
Added a
{{...|getattr}}template filter.This can be used by templates to fetch the attribute of an object. If not found,
Nonewill be returned.Added a
globaloption to the{% definevar %}template tag.This will register the variable in the top-most Django template context, allowing other blocks to use it. It’s suggested that consumers create an early block in the top-level template, and for sub-templates to override that block and register global variables.
The
{{...|json_dumps}}template filter now returns keys sorted.Removed the deprecated
root_url().Removed some long-deprecated modules:
djblets.util.cachedjblets.util.context_processorsdjblets.util.dbdjblets.util.dbevolutiondjblets.util.formsdjblets.util.miscdjblets.util.rooturldjblets.util.testingdjblets.util.urlresolvers
djblets.webapi¶
Added a new way of specifying field types in API resources.
Field definitions for API resources used to take in an int, str, list, etc. as a field type. This was limited and posed compatibility problems.
Consumers should now use one of the new field types, defined in
djblets.webapi.fields. They can also create their own, providing their own parsing/validation/serialization logic.Added an
_expandedfield to API resource responses when using?expand=....This is a dictionary contains information on the fields that were expanded. Each key is an expanded field name, and each value is a dictionary that may contain
item_mimetype,list_mimetype, andlist_urlfields. These are useful for clients that need to map expanded payloads to resource-specific handlers.All JSON payloads now sort dictionary keys alphabetically.
Removed the deprecated
djblets.webapi.coremodule.Removed the deprecated
queryarguments to theWebAPITestCaseMixinAPI invocation utility methods, in favor ofdata.
Contributors¶
Beth Rennie
Christian Hammond
David Trowbridge
Hailan Xu
Jacob Blazusiak
Mandeep Singh
Maram El-Salamouny
Monica Bui
Storm Kaefer