@@ -1559,7 +1559,7 @@ def retrieve_existing_civs(*, civ_data_objects):
15591559 elif civ_data .image :
15601560 try :
15611561 civs = ComponentInterfaceValue .objects .filter (
1562- interface__slug = civ_data .interface_slug ,
1562+ interface = civ_data .socket ,
15631563 image = civ_data .image ,
15641564 ).all ()
15651565 existing_civs .extend (civs )
@@ -1571,7 +1571,7 @@ def retrieve_existing_civs(*, civ_data_objects):
15711571 # values can be of different types, including None and False
15721572 try :
15731573 civs = ComponentInterfaceValue .objects .filter (
1574- interface__slug = civ_data .interface_slug ,
1574+ interface = civ_data .socket ,
15751575 value = civ_data .value ,
15761576 ).all ()
15771577 existing_civs .extend (civs )
@@ -2263,8 +2263,8 @@ def update_size_in_storage(self):
22632263class CIVData :
22642264
22652265 @property
2266- def interface_slug (self ):
2267- return self ._interface_slug
2266+ def socket (self ):
2267+ return self ._socket
22682268
22692269 @property
22702270 def value (self ):
@@ -2295,13 +2295,15 @@ def dicom_upload_with_name(self):
22952295 return self ._dicom_upload_with_name
22962296
22972297 def __repr__ (self ):
2298- return f"CIVData(interface_slug={ self ._interface_slug !r} , value={ self ._initial_value !r} )"
2298+ return (
2299+ f"CIVData(socket={ self ._socket !r} , value={ self ._initial_value !r} )"
2300+ )
22992301
23002302 def __str__ (self ):
23012303 return f"CIVData: { self .__dict__ } "
23022304
2303- def __init__ (self , * , interface_slug , value ):
2304- self ._interface_slug = interface_slug
2305+ def __init__ (self , * , socket , value ):
2306+ self ._socket = socket
23052307 self ._initial_value = value
23062308 self ._json_value = None
23072309 self ._image = None
@@ -2311,17 +2313,15 @@ def __init__(self, *, interface_slug, value):
23112313 self ._file_civ = None
23122314 self ._dicom_upload_with_name = None
23132315
2314- ci = ComponentInterface .objects .get (slug = interface_slug )
2315-
2316- if ci .super_kind == ci .SuperKind .VALUE :
2316+ if socket .super_kind == socket .SuperKind .VALUE :
23172317 self ._init_json_civ_data ()
2318- elif ci .super_kind == ci .SuperKind .IMAGE :
2318+ elif socket .super_kind == socket .SuperKind .IMAGE :
23192319 self ._init_image_civ_data ()
2320- elif ci .super_kind == ci .SuperKind .FILE :
2320+ elif socket .super_kind == socket .SuperKind .FILE :
23212321 self ._init_file_civ_data ()
23222322 else :
23232323 raise NotImplementedError (
2324- f"Unknown interface super kind: { ci .super_kind } "
2324+ f"Unknown interface super kind: { socket .super_kind } "
23252325 )
23262326
23272327 self .validate ()
@@ -2334,7 +2334,7 @@ def _init_json_civ_data(self):
23342334 self ._json_value = self ._initial_value
23352335 else :
23362336 raise ValidationError (
2337- f"Unknown data type { type (self ._initial_value )} for interface { self ._interface_slug } "
2337+ f"Unknown data type { type (self ._initial_value )} for interface { self ._socket } "
23382338 )
23392339
23402340 def _init_image_civ_data (self ):
@@ -2352,7 +2352,7 @@ def _init_image_civ_data(self):
23522352 self ._image = None
23532353 else :
23542354 raise ValidationError (
2355- f"Unknown data type { type (self ._initial_value )} for interface { self ._interface_slug } "
2355+ f"Unknown data type { type (self ._initial_value )} for interface { self ._socket } "
23562356 )
23572357
23582358 def _init_file_civ_data (self ):
@@ -2364,7 +2364,7 @@ def _init_file_civ_data(self):
23642364 self ._file_civ = None
23652365 else :
23662366 raise ValidationError (
2367- f"Unknown data type { type (self ._initial_value )} for interface { self ._interface_slug } "
2367+ f"Unknown data type { type (self ._initial_value )} for interface { self ._socket } "
23682368 )
23692369
23702370 def validate (self ):
@@ -2464,17 +2464,17 @@ def _update_civ(self, *, civ_data, user=None, linked_task=None):
24642464
24652465 try :
24662466 if (
2467- civ_data .interface_slug
2467+ civ_data .socket . slug
24682468 not in self .base_object .allowed_socket_slugs
24692469 ):
24702470 raise CINotAllowedException (
2471- f"Socket { civ_data .interface_slug !r} is not allowed "
2471+ f"Socket { civ_data .socket !r} is not allowed "
24722472 f"for this { self .base_object ._meta .model_name } ."
24732473 )
24742474 except AttributeError :
24752475 pass
24762476
2477- ci = ComponentInterface . objects . get ( slug = civ_data .interface_slug )
2477+ ci = civ_data .socket
24782478 current_civ = self .get_current_value_for_interface (
24792479 interface = ci , user = user
24802480 )
0 commit comments