-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closes #20304: Object owners #20634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #20304: Object owners #20634
Conversation
… owner field to serializers
…nizational, and nested group models
|
Couple small things:
|
Done.
Made these DynamicModelMultipleChoiceFields and tweaked the label for user groups.
For now, yes. (We don't currently include any of the admin models in the global search.)
Owner groups exist simply to help organize owners. They aren't strictly needed but would be very helpful in a scenario where you have hundreds of owners to manage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Virtual Chassis Add / Edit is still missing the owner dropdown. Otherwise, everything else looks good.
|
Turns out we use a separate form for creating a virtual chassis, for some reason. |
Closes: #20304
Model Changes
users.OwnerGroupmodel (for organizing owners)users.Ownermodel, with M2M fields to Group and UserOwnerMixinto attach a ForeignKey field tousers.Ownerextrasapp which don't inherit from one of the three bases aboveFilterSet Changes
OwnerFilterMixinand add it to the three base FilterSet classesForm Changes
netbox.formsownerfield to the base classes, which derive from NetBoxModel (and it ensures consistency for future work)Table Changes
ownercolumn on eachREST API Serializer Changes
netbox.api.serializers_.featuresnetbox.api.serializers_.modelsnetbox.api.serializers_.bulknetbox.api.serializers_.modelsfor consistency with the base model classesownerfieldGraphQL API Type Changes
users.graphql.mixins.OwnerMixinto add theownerfieldTests
AdminModelViewTestCasebase classReviewer Notes
Boilerplate changes to apps other than
userscomprise a large portion (if not the majority) of this PR. Spot checking is sufficient for the following files:*/api/serializers_/*.py- Changed base serializer classes*/forms/bulk_edit.py- Changed base form classes; removed redundant form fields*/forms/bulk_import.py- Changed base form classes; removed redundant form fields*/forms/filtersets.py- Changed base form classes; updated fieldsets*/forms/model_forms.py- Changed base form classes; removed redundant form fields*/graphql/types.py- Changed base type classes*/tables/*.py- Changed base table & Meta classes; removed redundant table columns*/filtersets.py- Changed base FilterSet classesThe bulk of the important changes appear under the
netbox,users, andutilitiesapps.