@@ -19,7 +19,7 @@ def __new__(mcs, name, bases, attrs):
1919 # Device component
2020 if hasattr (term_cls , 'device' ):
2121
22- attrs [f'termination_{ cable_end } _device' ] = DynamicModelChoiceField (
22+ attrs [f'termination_{ cable_end } _device' ] = DynamicModelMultipleChoiceField (
2323 queryset = Device .objects .all (),
2424 label = _ ('Device' ),
2525 required = False ,
@@ -33,6 +33,7 @@ def __new__(mcs, name, bases, attrs):
3333 label = term_cls ._meta .verbose_name .title (),
3434 context = {
3535 'disabled' : '_occupied' ,
36+ 'parent' : 'device' ,
3637 },
3738 query_params = {
3839 'device_id' : f'$termination_{ cable_end } _device' ,
@@ -43,7 +44,7 @@ def __new__(mcs, name, bases, attrs):
4344 # PowerFeed
4445 elif term_cls == PowerFeed :
4546
46- attrs [f'termination_{ cable_end } _powerpanel' ] = DynamicModelChoiceField (
47+ attrs [f'termination_{ cable_end } _powerpanel' ] = DynamicModelMultipleChoiceField (
4748 queryset = PowerPanel .objects .all (),
4849 label = _ ('Power Panel' ),
4950 required = False ,
@@ -57,6 +58,7 @@ def __new__(mcs, name, bases, attrs):
5758 label = _ ('Power Feed' ),
5859 context = {
5960 'disabled' : '_occupied' ,
61+ 'parent' : 'powerpanel' ,
6062 },
6163 query_params = {
6264 'power_panel_id' : f'$termination_{ cable_end } _powerpanel' ,
@@ -66,7 +68,7 @@ def __new__(mcs, name, bases, attrs):
6668 # CircuitTermination
6769 elif term_cls == CircuitTermination :
6870
69- attrs [f'termination_{ cable_end } _circuit' ] = DynamicModelChoiceField (
71+ attrs [f'termination_{ cable_end } _circuit' ] = DynamicModelMultipleChoiceField (
7072 queryset = Circuit .objects .all (),
7173 label = _ ('Circuit' ),
7274 selector = True ,
@@ -79,6 +81,7 @@ def __new__(mcs, name, bases, attrs):
7981 label = _ ('Side' ),
8082 context = {
8183 'disabled' : '_occupied' ,
84+ 'parent' : 'circuit' ,
8285 },
8386 query_params = {
8487 'circuit_id' : f'$termination_{ cable_end } _circuit' ,
0 commit comments