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

@@ -15,7 +15,7 @@ class TenantGroupTestCase(ViewTestCases.OrganizationalObjectViewTestCase):
tenant_groups = (
TenantGroup(name='Tenant Group 1', slug='tenant-group-1'),
TenantGroup(name='Tenant Group 2', slug='tenant-group-2'),
TenantGroup(name='Tenant Group 2', slug='tenant-group-2', comments='Tenant Group 2 comment'),
TenantGroup(name='Tenant Group 3', slug='tenant-group-3'),
)
for tenanantgroup in tenant_groups:
@@ -28,24 +28,26 @@ class TenantGroupTestCase(ViewTestCases.OrganizationalObjectViewTestCase):
'slug': 'tenant-group-x',
'description': 'A new tenant group',
'tags': [t.pk for t in tags],
'comments': 'Tenant Group X comment',
}
cls.csv_data = (
"name,slug,description",
"Tenant Group 4,tenant-group-4,Fourth tenant group",
"Tenant Group 5,tenant-group-5,Fifth tenant group",
"Tenant Group 6,tenant-group-6,Sixth tenant group",
"name,slug,description,comments",
"Tenant Group 4,tenant-group-4,Fourth tenant group,",
"Tenant Group 5,tenant-group-5,Fifth tenant group,",
"Tenant Group 6,tenant-group-6,Sixth tenant group,Sixth tenant group comment",
)
cls.csv_update_data = (
"id,name,description",
f"{tenant_groups[0].pk},Tenant Group 7,Fourth tenant group7",
f"{tenant_groups[1].pk},Tenant Group 8,Fifth tenant group8",
f"{tenant_groups[2].pk},Tenant Group 0,Sixth tenant group9",
"id,name,description,comments",
f"{tenant_groups[0].pk},Tenant Group 7,Fourth tenant group7,Group 7 comment",
f"{tenant_groups[1].pk},Tenant Group 8,Fifth tenant group8,",
f"{tenant_groups[2].pk},Tenant Group 0,Sixth tenant group9,",
)
cls.bulk_edit_data = {
'description': 'New description',
'comments': 'New comment',
}