Commit Graph

3469 Commits

Author SHA1 Message Date
Jeremy Stretch
8b348d30e1 Move choice sets from utilities.choices to netbox.choices 2024-03-22 08:59:52 -04:00
Jeremy Stretch
c928756396 Use FieldSet instances for all forms 2024-03-19 13:34:13 -04:00
Jeremy Stretch
2730bd5712 Refactor form rendering components & add docstrings 2024-03-19 13:34:13 -04:00
Jeremy Stretch
6bc5eed79d Enable tabbed group fields in fieldsets 2024-03-19 13:34:13 -04:00
Jeremy Stretch
251688dca8 Introduce InlineFields for rendering fields side-by-side 2024-03-19 13:34:13 -04:00
Daniel Sheppard
32c08fc358 Closes: #13918 - Add facility field (#15456)
* Fixes: #13918 - Add facilities field to Location model.

* Stupidly forgot to `git add`

* Fix errant reference to site.

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-03-18 10:09:50 -04:00
Jeremy Stretch
521735c400 Merge branch 'develop' into feature 2024-03-15 12:32:54 -04:00
Jeremy Stretch
553121da76 Closes #14454: Include member devices for virtual chassis in REST API 2024-03-13 19:11:28 -04:00
Jeremy Stretch
dd66e29c70 Fixes #15322: Add description field to YAML export for device & module types 2024-03-13 19:10:49 -04:00
Jeremy Stretch
34d8c5a61d Fixes #15356: Fix assignment of front & rear images to device types via REST API 2024-03-13 19:10:30 -04:00
Jeremy Stretch
689b8fa938 Ensure all filter labels are translated 2024-03-12 12:14:13 -04:00
Jeremy Stretch
bc49f301d2 Declare FilterSet fields as a tuple 2024-03-12 12:08:11 -04:00
Markku Leiniö
656ce82049 Closes #14206: Add FC SFP types 2024-03-12 09:03:42 -04:00
Jeremy Stretch
458a80244a Clean up exemption logic 2024-03-11 15:54:35 -04:00
Jeremy Stretch
d3bf6c838d Validate filter class for foreign key fields 2024-03-11 14:39:34 -04:00
Jeremy Stretch
69f370fddc Add missing filters for reverse many-to-many relationships 2024-03-11 14:39:34 -04:00
Jeremy Stretch
a547155241 Test for missing ManyToManyField filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
4f863af698 Fix remaining tests 2024-03-11 14:39:34 -04:00
Jeremy Stretch
813ec0c7f3 Add missing filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
411862a55e Add tests for missing FilterSet filters 2024-03-11 14:39:34 -04:00
Jeremy Stretch
28dbb0872a Closes #15383: Standardize filtering logic for the parents of recursively-nested models 2024-03-11 13:27:57 -04:00
Jeremy Stretch
6372d3be41 Closes #15297: Linkify platform column in device & virtual machine tables 2024-03-08 16:48:39 -05:00
Jeremy Stretch
9134873151 Merge branch 'feature' into 15277-object-types 2024-03-05 08:52:07 -05:00
Jeremy Stretch
1fb5c9035a Merge branch 'feature' into 15278-primary-nested-serializers 2024-03-04 16:42:36 -05:00
Jeremy Stretch
b53a99cae8 Clean up outdated references to ContentType 2024-03-04 10:46:34 -05:00
Jeremy Stretch
b2857ab559 Rename CustomField.content_types to object_types & use ObjectType proxy 2024-03-04 08:33:44 -05:00
Jeremy Stretch
903f02ff01 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
Jeremy Stretch
86673156db Closes #15292: Remove obsolete device_role attribute from Device model 2024-03-01 11:31:47 -05:00
Arthur
60ede24657 15232 fix inventory item template permission 2024-02-29 15:30:51 -05:00
Jeremy Stretch
f7430b1156 Rename 'requested_fields' kwarg to 'fields' on BaseSerializer 2024-02-27 17:01:29 -05:00
Jeremy Stretch
6f74b77dde Initialize dynamically-resolved serializers with nested=True 2024-02-27 14:56:36 -05:00
Jeremy Stretch
66cc58e7d0 Add dynamic nesting support to SerializedPKRelatedField 2024-02-27 14:00:42 -05:00
Jeremy Stretch
de0427a45b Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
Jeremy Stretch
aea8c693f5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
Jeremy Stretch
5c2f7fa59c Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
Abhimanyu Saharan
5f2b5c1045 Added installed_module on NestedModuleBaySerializer (#15245)
* added installed_module on NestedModuleBaySerializer #15243

* Update test

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-23 15:54:47 -05:00
Jeremy Stretch
c9a62ed6bd Closes #15235: Use primary serializers for REST API "brief" mode (#15246)
* Use primary serializers for brief mode

* Remove BriefModeMixin

* Correct ModuleBayTest brief_fields (see #15243)
2024-02-23 14:21:25 -05:00
Jeremy Stretch
703791326d Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
Jeremy Stretch
fd7bccb2d9 Closes #15042: Move model registration logic to AppConfigs (#15203)
* Closes #15042: Move model registration logic to AppConfigs

* Refactor register_model() to accept multiple models
2024-02-21 14:22:13 -05:00
Abhimanyu Saharan
9682236373 fixed location import #14064 2024-02-21 14:10:10 -05:00
Abhimanyu Saharan
19788d1d31 Fixes the rackelevation api schema (#15214)
* fixes the rackelevation api schema #15101

* fixes the rackelevation api schema #15101
2024-02-21 13:39:32 -05:00
Arthur Hanson
9ac4be7379 14405 render link_peer to CSV (#15201)
* 14405 render link_peer to csv

* 14405 review changes
2024-02-20 16:24:14 -05:00
Abhimanyu Saharan
fbaed07250 Added allow_null for front and rear image on api (#15200)
* added allow_null for front and rear image on api #15184

* added allow_null for front and rear image on api #15184
2024-02-20 13:53:56 -05:00
Arthur Hanson
16712ad8d9 15094 Add missing gettext to error strings for internationalization (#15155)
* 15049 add missing gettext to error strings

* 15049 add missing gettext to error strings

* 15094 review change

* 15094 review change

* Formatting cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:44:02 -05:00
Daniel Sheppard
233ebe4327 Fixes: #14058 - Limits platform selection to manufacturer and platforms with no manufacturer (#15183)
* Fixes: #14058 - Limits platform selection to manufacturer and platforms with no manufacturer

* Apply suggestions from code review

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:28:15 -05:00
Jeremy Stretch
aee02c168c Closes #15131: Dynamic queryset annotations for REST API endpoints (#15152)
* Introduce RelatedObjectCountField

* Introduce get_annotations_for_serializer() and enable dynamic annotations

* Add RelatedObjectCountFields to serializers; remove static annotations from querysets

* Remove annotations cleanup logic from BriefModeMixin

* Annotate type for RelatedObjectCountField

* Remove redundant field on TagSerializer

* Add missing reverse relationship for power feeds to rack

* Refactor RelatedObjectCountField to take a single relationship name
2024-02-15 14:49:27 -05:00
Jeremy Stretch
214c91a78e Closes #15087: Support for specifying a subset of API serializer fields (#15122)
* Enable dynamic field inclusion for REST API serializers

* Recurse through nested serializer when resolving prefetches

* Remove obsolete calls to prefetch_related() for API views

* Remove support for brief_prefetch_fields viewset attribute

* Rename query parameter

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode (#15134)

* Fixes #15133: Fix FHRP group representation on assignments endpoint under brief mode

* Update API test

* Restore get_queryset() on BriefModeMixin, minus prefetch logic

* get_prefetches_for_serializer() should reference serializer field source if set
2024-02-14 09:28:37 -05:00
Jeremy Stretch
f4a5a8cb33 Closes #13283: Add context to dropdown options (#15104)
* Initial work on #13283

* Enable passing TomSelect HTML template attibutes on DynamicModelChoiceField

* Merge disabled_indicator into option_attrs

* Add support for annotating a numeric count on dropdown options

* Annotate parent object on relevant fields

* Improve rendering of color options

* Improve rendering of color options

* Rename option_attrs to context

* Expose option context on ObjectVar for custom scripts

* Document dropdown context variables
2024-02-13 16:31:17 -05:00
Jeremy Stretch
8e79baafb0 Fixes #15059: Correct IP address count link in VM interfaces table 2024-02-13 12:16:11 -05:00
Jeremy Stretch
9133e710f9 Fixes #15067: Fix uncaught exception when attempting invalid device bay import 2024-02-13 12:15:15 -05:00