Closes #1512: Added a view to search for an IP address being assigned to an interface

This commit is contained in:
Jeremy Stretch
2017-11-10 11:58:59 -05:00
parent e1d655cb23
commit a0bb7b08bd
7 changed files with 132 additions and 5 deletions

View File

@@ -688,6 +688,11 @@ class IPAddressBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
nullable_fields = ['vrf', 'role', 'tenant', 'description']
class IPAddressAssignForm(BootstrapMixin, forms.Form):
vrf = forms.ModelChoiceField(queryset=VRF.objects.all(), required=False, label='VRF')
address = forms.CharField(label='IP Address')
def ipaddress_status_choices():
status_counts = {}
for status in IPAddress.objects.values('status').annotate(count=Count('status')).order_by('status'):