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 .rendering import FieldSet
12
18
from utilities .forms .fields import CommentField , DynamicModelChoiceField
@@ -445,12 +451,37 @@ class ACLStandardRuleForm(NetBoxModelForm):
445
451
),
446
452
label = "Access List" ,
447
453
)
454
+
448
455
source_prefix = DynamicModelChoiceField (
449
456
queryset = Prefix .objects .all (),
450
457
required = False ,
451
458
help_text = help_text_acl_rule_logic ,
452
459
label = "Source Prefix" ,
453
460
)
461
+ source_iprange = DynamicModelChoiceField (
462
+ queryset = IPRange .objects .all (),
463
+ required = False ,
464
+ help_text = help_text_acl_rule_logic ,
465
+ label = "Source IP-Range" ,
466
+ )
467
+ source_ipaddress = DynamicModelChoiceField (
468
+ queryset = IPAddress .objects .all (),
469
+ required = False ,
470
+ help_text = help_text_acl_rule_logic ,
471
+ label = "Source IP-Address" ,
472
+ )
473
+ source_aggregate = DynamicModelChoiceField (
474
+ queryset = Aggregate .objects .all (),
475
+ required = False ,
476
+ help_text = help_text_acl_rule_logic ,
477
+ label = "Source Aggregate" ,
478
+ )
479
+ source_service = DynamicModelChoiceField (
480
+ queryset = Service .objects .all (),
481
+ required = False ,
482
+ help_text = help_text_acl_rule_logic ,
483
+ label = "Source Service" ,
484
+ )
454
485
455
486
fieldsets = (
456
487
FieldSet ("access_list" , "description" , "tags" , name = _ ('Access List Details' )),
@@ -463,7 +494,13 @@ class Meta:
463
494
"index" ,
464
495
"action" ,
465
496
"remark" ,
497
+
466
498
"source_prefix" ,
499
+ "source_iprange" ,
500
+ "source_ipaddress" ,
501
+ "source_aggregate" ,
502
+ "source_service" ,
503
+
467
504
"tags" ,
468
505
"description" ,
469
506
)
0 commit comments