diff --git a/docs/release-notes/version-3.5.md b/docs/release-notes/version-3.5.md index 6d0ab1834..ae2d319b3 100644 --- a/docs/release-notes/version-3.5.md +++ b/docs/release-notes/version-3.5.md @@ -4,10 +4,11 @@ ### Enhancements -* [#11517](https://github.com/netbox-community/netbox/issues/11517) - Standardize the inclusion of related objects across the entire UI -* [#11584](https://github.com/netbox-community/netbox/issues/11584) - Add a list view for contact assignments * [#11254](https://github.com/netbox-community/netbox/issues/11254) - Introduce the `X-Request-ID` HTTP header to annotate the unique ID of each request for change logging * [#11440](https://github.com/netbox-community/netbox/issues/11440) - Add an `enabled` field for device type interfaces +* [#11517](https://github.com/netbox-community/netbox/issues/11517) - Standardize the inclusion of related objects across the entire UI +* [#11584](https://github.com/netbox-community/netbox/issues/11584) - Add a list view for contact assignments +* [#11625](https://github.com/netbox-community/netbox/issues/11625) - Add HTMX support to ObjectEditView ### Other Changes diff --git a/netbox/netbox/views/generic/object_views.py b/netbox/netbox/views/generic/object_views.py index 475cca9d3..2dff8b274 100644 --- a/netbox/netbox/views/generic/object_views.py +++ b/netbox/netbox/views/generic/object_views.py @@ -218,6 +218,12 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView): form = self.form(instance=obj, initial=initial_data) restrict_form_fields(form, request.user) + # If this is an HTMX request, return only the rendered form HTML + if is_htmx(request): + return render(request, 'htmx/form.html', { + 'form': form, + }) + return render(request, self.template_name, { 'model': model, 'object': obj, diff --git a/netbox/templates/generic/object_edit.html b/netbox/templates/generic/object_edit.html index c61fb723f..8531ad6df 100644 --- a/netbox/templates/generic/object_edit.html +++ b/netbox/templates/generic/object_edit.html @@ -1,6 +1,4 @@ {% extends 'base/layout.html' %} -{% load form_helpers %} -{% load helpers %} {% comment %} Blocks: @@ -48,56 +46,11 @@ Context: