Review tweaks

This commit is contained in:
Brian Tiemann
2026-03-10 16:23:42 -04:00
parent 07db50dd73
commit 4ef39db4d4
7 changed files with 8 additions and 11 deletions
+2 -1
View File
@@ -26,12 +26,13 @@ __all__ = (
class CableBundleSerializer(PrimaryModelSerializer):
cable_count = serializers.IntegerField(read_only=True, default=None)
class Meta:
model = CableBundle
fields = [
'id', 'url', 'display_url', 'display', 'name', 'description', 'comments', 'tags',
'custom_fields', 'created', 'last_updated',
'custom_fields', 'created', 'last_updated', 'cable_count',
]
brief_fields = ('id', 'url', 'display', 'name', 'description')
+1 -1
View File
@@ -856,7 +856,7 @@ class CableBulkEditForm(PrimaryModelBulkEditForm):
model = Cable
fieldsets = (
FieldSet('type', 'status', 'profile', 'tenant', 'label', 'description'),
FieldSet('type', 'status', 'profile', 'tenant', 'bundle', 'label', 'description'),
FieldSet('color', 'length', 'length_unit', name=_('Attributes')),
)
nullable_fields = (
+1
View File
@@ -1179,6 +1179,7 @@ class CableBundleFilterForm(PrimaryModelFilterSetForm):
FieldSet('q', 'filter_id', 'tag'),
FieldSet('name', name=_('Attributes')),
)
tag = TagFilterField(model)
class CableFilterForm(TenancyFilterForm, PrimaryModelFilterSetForm):
+1 -1
View File
@@ -108,7 +108,7 @@ __all__ = (
)
@strawberry_django.filter(models.CableBundle, lookups=True)
@strawberry_django.filter_type(models.CableBundle, lookups=True)
class CableBundleFilter(PrimaryModelFilter):
name: StrFilterLookup[str] | None = strawberry_django.filter_field()
@@ -48,6 +48,7 @@ class Migration(migrations.Migration):
on_delete=django.db.models.deletion.SET_NULL,
related_name='cables',
to='dcim.cablebundle',
verbose_name='bundle',
),
),
]
+2 -2
View File
@@ -4036,8 +4036,8 @@ class CableBundleView(generic.ObjectView):
queryset = CableBundle.objects.all()
def get_extra_context(self, request, instance):
# Not prefetching terminations as they are not included in the default inline table layout. See CableListView
# for prefetch pattern if terminations are necessary here.
# Not prefetching related cable terminations as they are not included in the default inline CableTable layout.
# See CableListView for prefetch pattern if terminations are necessary here.
cables_table = tables.CableTable(
instance.cables.all(),
orderable=False,
-6
View File
@@ -21,12 +21,6 @@
<th scope="row">{% trans "Description" %}</th>
<td>{{ object.description|placeholder }}</td>
</tr>
<tr>
<th scope="row">{% trans "Cables" %}</th>
<td>
<a href="{% url 'dcim:cable_list' %}?bundle_id={{ object.pk }}">{{ object.cables.count }}</a>
</td>
</tr>
</table>
</div>
{% include 'inc/panels/custom_fields.html' %}