1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

589 Commits

Author SHA1 Message Date
bea32aef71 Declare FilterSet fields as a tuple 2024-03-12 12:08:11 -04:00
d6acc18c29 Closes #15383: Standardize filtering logic for the parents of recursively-nested models 2024-03-11 13:27:57 -04:00
6f6d483ca5 Merge branch 'feature' into 15277-object-types 2024-03-05 08:52:07 -05:00
0419a69ae8 Clean up outdated references to ContentType 2024-03-04 10:46:34 -05:00
5f43eabab1 Rename ContactAssignment.content_type to object_type 2024-03-04 08:33:44 -05:00
e0165539b3 Rename ImageAttachment.content_type to object_type 2024-03-04 08:33:44 -05:00
0df68bf291 Rename ContentType proxy model to ObjectType 2024-03-04 08:33:44 -05:00
78e284c14f Initialize dynamically-resolved serializers with nested=True 2024-02-27 14:56:36 -05:00
c382ba0ae0 Refactor REST API serializers to avoid circular imports 2024-02-27 13:26:43 -05:00
c146f5e1b5 Replace nested serializers with primary serializers where possible 2024-02-26 16:49:30 -05:00
d042e6f69d Closes #15238: Include description field in brief mode 2024-02-26 11:39:31 -05:00
3f3bcc5eb5 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
5f159795dd 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
7abb2b2ab5 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
b3f25a400b 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
74e67afa41 Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
b554e70eda Squash migrations 2024-01-25 12:35:04 -05:00
222388b988 Revert "Closes #13647: Squash all migrations prior to v3.7 (#14853)"
This reverts commit 874685fd6f6b463e68fd2eef4711aa6765371a17.
2024-01-22 13:15:43 -05:00
874685fd6f Closes #13647: Squash all migrations prior to v3.7 (#14853)
* Regenerate pre-v3.7 migrations

* Annotate replaced migrations

* Rename dependencies; remove FeatureQuery references

* Add missed replacement
2024-01-19 13:55:22 -05:00
5de2dea8a6 Fixes #14816: Ensure default contact assignment ordering is consistent 2024-01-17 13:29:04 -05:00
d5c1cb0ef6 Merge branch 'develop' into feature 2023-12-28 14:20:04 -05:00
3ef2db81e8 Closes #14629: Add filter tests for all q and description filters 2023-12-28 13:53:16 -05:00
3bacee16bd Closes #14631: Ensure description filters are available on all relevant models 2023-12-28 13:53:16 -05:00
25e67eb555 Merge branch 'develop' into feature 2023-12-15 16:52:42 -05:00
929d4d2c95 Fixes #14522: Fix filtering contact assignments by group 2023-12-15 13:58:50 -05:00
b532435a6d Closes #14436: Add indexes for all GenericForeignKey fields (#14463)
* Closes #14436: Add PostgreSQL indexes for all GenericForeignKeys

* Add note about GFK indexes to developer docs
2023-12-07 14:02:51 -05:00
b83fcc6077 Merge branch 'develop' into feature 2023-11-29 20:25:44 -05:00
01ba4ce129 Fixes #14242: Enable export templates for contact assignments 2023-11-29 15:22:41 -05:00
e15647a2ce Closes #14153: Filter ContentTypes by supported feature (#14191)
* WIP

* Remove FeatureQuery

* Standardize use of proxy ContentType for models

* Remove TODO

* Correctly filter BookmarksWidget object_types choices

* Add feature-specific object type validation
2023-11-16 12:12:51 -05:00
69a4c31072 Closes #13794: Dynamically populate related objects list under tenant view (#14196)
* Closes #13794: Dynamically populate related objects list under tenant view

* get_related_models() should sort models alphabetically by default

* Reference Meta.related_objects instead of calling get_fields()
2023-11-16 12:02:32 -05:00
3d20276f55 Closes #14134: Display additional object attributes in global search results (#14154)
* WIP

* Add display_attrs for all indexers

* Linkify object attributes

* Clean up prefetch logic

* Use tooltips for display attributes

* Simplify template code

* Introduce get_indexer() utility function

* Add  to examples in docs

* Use tooltips to display long strings
2023-11-09 16:21:09 -05:00
2562c8745c Closes #14156: Add custom field support for contact assignments 2023-11-09 16:10:14 -05:00
ac91d4e5e5 Merge branch 'develop' into feature 2023-11-09 16:06:26 -05:00
ad95760ead adds contact group on contact assignment table #14221 2023-11-09 14:12:10 -05:00
66b9cdf141 adds import button on the contact assignment table #13669 2023-11-08 12:37:13 -05:00
450790ab4a Closes #13550: Refactor view action mappings (#14062)
* Merge actions and action_perms into a single mapping

* Update obsolete permission maps

* Update obsolete action lists

* Normalize empty permission mappings

* Cleanup

* Add deprecation warnings

* Introduce DEFAULT_ACTION_PERMISSIONS constant
2023-10-20 15:08:09 -04:00
d77d45e795 12336 make region API calls atomic (#13942)
* 12336 make region API calls atomic

* 12336 switch to pg locks

* 12336 add locks to all views using mptt models

* 12336 fix ADVISORY_LOCK_KEYS reference

* 12336 review changes

* Tweak advisory lock numbering

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-10-17 10:35:01 -04:00
9aa7444bf9 Fixes #13782: Fix tag exclusion support for contact assignments 2023-09-18 11:08:49 -04:00
914588f55d Merge branch 'develop' into feature 2023-08-09 15:31:21 -04:00
545769ad88 Adds generic object children template (#13388)
* adds generic tab view template #12110

* Rename view_tab.html and move to generic/

* Fix console ports template

* Move bulk operations view resolution to template

* Avoid setting default template_name on ObjectChildrenView

* Move base_template and table_config context vars to base context

* removed bulk_delete_control from templates

* refactored bulk_controls view

* fixed table_config

* renamed object_tab.html to objectchildren_list.html

* removed unused import

* Refactor template blocks for bulk operation buttons

* Rename object children generic template

* Move disconnect bulk action into a separate template for device components

* Fix cluster devices & VM interfaces views

* minor button label change

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-09 14:16:03 -04:00
16bcb1dbb0 #13426: Employ proper feature keys for image attachment & contact filter forms 2023-08-09 10:41:40 -04:00
2afce6c94b Introduce ContactsMixin 2023-08-04 10:15:50 -04:00
caedc8dbe3 Closes #13352: Translation support for model verbose names (#13354)
* Update verbose_name & verbose_name_plural Meta attributes on all models

* Alter makemigrations to ignore verbose_name & verbose_name_plural changes
2023-08-03 10:41:10 -04:00
cbf4b43b35 Adds tags on contact assignment (#13328)
* adds tags on contact assignments #12882

* updated migration

* added tags on import form

* adds TagsMixin on ContactAssignmentType #12882

* Misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-01 11:52:14 -04:00
e625a5667c Closes #13279: Wrap choice labels with gettext()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 17:31:07 -04:00
e284cd7e54 Closes #13150: Wrap table column headers with gettext()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 14:35:28 -04:00
b7a9649269 Closes #13149: Wrap form field labels with gettext_lazy()
Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 12:52:38 -04:00
83bebc1bd2 Closes #13132: Wrap verbose_name and other model text with gettext_lazy() (i18n)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 11:28:07 -04:00
36f95f7842 Adds tenant on power feed (#13300)
* adds tenant on power feed

* cleanup

* adds power feed count on tenant object view

* Misc cleanup; add filterset tests

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-31 08:20:48 -04:00
2aa51d0d94 Adds contact assignment bulk import (#13109)
* adds contact assignment bulk import #11307

* Remove unsupported tags field added by NetBoxModelImportForm

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-28 09:23:22 -04:00