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

@@ -202,6 +202,16 @@ class TenantGroupFilterSet(OrganizationalModelFilterSet):
model = TenantGroup
fields = ('id', 'name', 'slug', 'description')
def search(self, queryset, name, value):
if not value.strip():
return queryset
return queryset.filter(
Q(name__icontains=value) |
Q(slug__icontains=value) |
Q(description__icontains=value) |
Q(comments__icontains=value)
)
class TenantFilterSet(NetBoxModelFilterSet, ContactModelFilterSet):
group_id = TreeNodeMultipleChoiceFilter(