|
5 | 5 | from dcim.models import Device, Interface, Region, Site, SiteGroup, VirtualChassis
|
6 | 6 | from django import forms
|
7 | 7 | from django.utils.translation import gettext as _
|
8 |
| -from ipam.models import Prefix |
| 8 | +from ipam.models import ( |
| 9 | + Prefix, |
| 10 | + IPRange, |
| 11 | + IPAddress, |
| 12 | + Aggregate, |
| 13 | + Service, |
| 14 | +) |
9 | 15 | from netbox.forms import NetBoxModelFilterSetForm
|
10 | 16 | from utilities.forms.rendering import FieldSet
|
11 | 17 | from utilities.forms.fields import (
|
@@ -181,6 +187,31 @@ class ACLStandardRuleFilterForm(NetBoxModelFilterSetForm):
|
181 | 187 | required=False,
|
182 | 188 | label="Source Prefix",
|
183 | 189 | )
|
| 190 | + source_prefix = DynamicModelMultipleChoiceField( |
| 191 | + queryset=Prefix.objects.all(), |
| 192 | + required=False, |
| 193 | + label="Source Prefix", |
| 194 | + ) |
| 195 | + source_iprange = DynamicModelMultipleChoiceField( |
| 196 | + queryset=IPRange.objects.all(), |
| 197 | + required=False, |
| 198 | + label="Source IP-Range", |
| 199 | + ) |
| 200 | + source_ipaddress = DynamicModelMultipleChoiceField( |
| 201 | + queryset=IPAddress.objects.all(), |
| 202 | + required=False, |
| 203 | + label="Source IP-Address", |
| 204 | + ) |
| 205 | + source_aggregate = DynamicModelMultipleChoiceField( |
| 206 | + queryset=Aggregate.objects.all(), |
| 207 | + required=False, |
| 208 | + label="Source Aggregate", |
| 209 | + ) |
| 210 | + source_service = DynamicModelMultipleChoiceField( |
| 211 | + queryset=Service.objects.all(), |
| 212 | + required=False, |
| 213 | + label="Source Service", |
| 214 | + ) |
184 | 215 | action = forms.ChoiceField(
|
185 | 216 | choices=add_blank_choice(ACLRuleActionChoices),
|
186 | 217 | required=False,
|
|
0 commit comments