Adds TenantGroup.comments to the required locations

- [x] 1. Add the field to the model class
- [x] 2. Generate and run database migrations
- [NA] 3. Add validation logic to clean()
- [NA] 4. Update relevant querysets
- [x] 5. Update API serializer
- [x] 6. Add fields to forms
    - [x] tenancy.forms.model_forms, create/edit (e.g. model_forms.py)
    - [x] tenancy.forms.bulk_edit, bulk edit
    - [x] tenancy.forms.bulk_import, CSV import
    - [NA] filter (UI and API)
- [x] 7. Extend object filter set
- [x] 8. Add column to object table
- [x] 9. Update the SearchIndex
- [x] 10. Update the UI templates
- [x] 11. Create/extend test cases
    - [NA] models
    - [x] views
    - [NA] forms
    - [x] filtersets
    - [x] api
- [NA] 12. Update the model's documentation
This commit is contained in:
Jason Novinger
2025-03-11 11:07:05 -05:00
parent b8352260ee
commit 157df20ad4
11 changed files with 54 additions and 19 deletions

View File

@@ -33,9 +33,10 @@ class TenantGroupBulkEditForm(NetBoxModelBulkEditForm):
max_length=200,
required=False
)
comments = CommentField()
model = TenantGroup
nullable_fields = ('parent', 'description')
nullable_fields = ('parent', 'description', 'comments')
class TenantBulkEditForm(NetBoxModelBulkEditForm):

View File

@@ -31,7 +31,7 @@ class TenantGroupImportForm(NetBoxModelImportForm):
class Meta:
model = TenantGroup
fields = ('name', 'slug', 'parent', 'description', 'tags')
fields = ('name', 'slug', 'parent', 'description', 'tags', 'comments')
class TenantImportForm(NetBoxModelImportForm):

View File

@@ -27,6 +27,7 @@ class TenantGroupForm(NetBoxModelForm):
required=False
)
slug = SlugField()
comments = CommentField()
fieldsets = (
FieldSet('parent', 'name', 'slug', 'description', 'tags', name=_('Tenant Group')),
@@ -35,7 +36,7 @@ class TenantGroupForm(NetBoxModelForm):
class Meta:
model = TenantGroup
fields = [
'parent', 'name', 'slug', 'description', 'tags',
'parent', 'name', 'slug', 'description', 'tags', 'comments'
]