mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
Address PR feedback, add Services to FHRP Group related objects
This commit is contained in:
parent
8cb2b8b87a
commit
37a2d902a5
@ -1161,7 +1161,7 @@ class FHRPGroupListView(generic.ObjectListView):
|
|||||||
|
|
||||||
|
|
||||||
@register_model_view(FHRPGroup)
|
@register_model_view(FHRPGroup)
|
||||||
class FHRPGroupView(generic.ObjectView):
|
class FHRPGroupView(GetRelatedModelsMixin, generic.ObjectView):
|
||||||
queryset = FHRPGroup.objects.all()
|
queryset = FHRPGroup.objects.all()
|
||||||
|
|
||||||
def get_extra_context(self, request, instance):
|
def get_extra_context(self, request, instance):
|
||||||
@ -1173,6 +1173,18 @@ class FHRPGroupView(generic.ObjectView):
|
|||||||
members_table.columns.hide('group')
|
members_table.columns.hide('group')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
'related_models': self.get_related_models(
|
||||||
|
request, instance,
|
||||||
|
extra=(
|
||||||
|
(
|
||||||
|
Service.objects.restrict(request.user, 'view').filter(
|
||||||
|
parent_object_type=ContentType.objects.get_for_model(FHRPGroup),
|
||||||
|
parent_object_id=instance.id,
|
||||||
|
),
|
||||||
|
'fhrpgroup_id'
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
'members_table': members_table,
|
'members_table': members_table,
|
||||||
'member_count': FHRPGroupAssignment.objects.filter(group=instance).count(),
|
'member_count': FHRPGroupAssignment.objects.filter(group=instance).count(),
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
{% include 'inc/panels/related_objects.html' %}
|
||||||
{% include 'inc/panels/custom_fields.html' %}
|
{% include 'inc/panels/custom_fields.html' %}
|
||||||
{% plugin_right_page object %}
|
{% plugin_right_page object %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user