6
6
from django .contrib .contenttypes .models import ContentType
7
7
from django .core .exceptions import ValidationError
8
8
from django .utils .safestring import mark_safe
9
- from ipam .models import Prefix
9
+ from ipam .models import (
10
+ Prefix ,
11
+ IPRange ,
12
+ IPAddress ,
13
+ Aggregate ,
14
+ Service ,
15
+ )
10
16
from netbox .forms import NetBoxModelForm
11
17
from utilities .forms .fields import CommentField , DynamicModelChoiceField
12
18
from virtualization .models import (
@@ -432,12 +438,37 @@ class ACLStandardRuleForm(NetBoxModelForm):
432
438
),
433
439
label = "Access List" ,
434
440
)
441
+
435
442
source_prefix = DynamicModelChoiceField (
436
443
queryset = Prefix .objects .all (),
437
444
required = False ,
438
445
help_text = help_text_acl_rule_logic ,
439
446
label = "Source Prefix" ,
440
447
)
448
+ source_iprange = DynamicModelChoiceField (
449
+ queryset = IPRange .objects .all (),
450
+ required = False ,
451
+ help_text = help_text_acl_rule_logic ,
452
+ label = "Source IP-Range" ,
453
+ )
454
+ source_ipaddress = DynamicModelChoiceField (
455
+ queryset = IPAddress .objects .all (),
456
+ required = False ,
457
+ help_text = help_text_acl_rule_logic ,
458
+ label = "Source IP-Address" ,
459
+ )
460
+ source_aggregate = DynamicModelChoiceField (
461
+ queryset = Aggregate .objects .all (),
462
+ required = False ,
463
+ help_text = help_text_acl_rule_logic ,
464
+ label = "Source Aggregate" ,
465
+ )
466
+ source_service = DynamicModelChoiceField (
467
+ queryset = Service .objects .all (),
468
+ required = False ,
469
+ help_text = help_text_acl_rule_logic ,
470
+ label = "Source Service" ,
471
+ )
441
472
442
473
fieldsets = (
443
474
("Access List Details" , ("access_list" , "description" , "tags" )),
@@ -451,7 +482,13 @@ class Meta:
451
482
"index" ,
452
483
"action" ,
453
484
"remark" ,
485
+
454
486
"source_prefix" ,
487
+ "source_iprange" ,
488
+ "source_ipaddress" ,
489
+ "source_aggregate" ,
490
+ "source_service" ,
491
+
455
492
"tags" ,
456
493
"description" ,
457
494
)
0 commit comments