Skip to content
Snippets Groups Projects
Commit dd55daec authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context component:

- improved retrieval of slices in SliceModel
parent df0d69a7
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!24Integrate NFV-SDN'22 demo
...@@ -93,7 +93,11 @@ class SliceModel(Model): ...@@ -93,7 +93,11 @@ class SliceModel(Model):
def dump_subslice_ids(self) -> List[Dict]: def dump_subslice_ids(self) -> List[Dict]:
from .RelationModels import SliceSubSliceModel # pylint: disable=import-outside-toplevel from .RelationModels import SliceSubSliceModel # pylint: disable=import-outside-toplevel
db_subslices = get_related_objects(self, SliceSubSliceModel, 'sub_slice_fk') db_subslices = get_related_objects(self, SliceSubSliceModel, 'sub_slice_fk')
return [db_subslice.dump_id() for db_subslice in sorted(db_subslices, key=operator.attrgetter('pk'))] return [
db_subslice.dump_id()
for db_subslice in sorted(db_subslices, key=operator.attrgetter('pk'))
if db_subslice.pk != self.pk # if I'm subslice of other slice, I will appear as subslice of myself
]
def dump( # pylint: disable=arguments-differ def dump( # pylint: disable=arguments-differ
self, include_endpoint_ids=True, include_constraints=True, include_config_rules=True, self, include_endpoint_ids=True, include_constraints=True, include_config_rules=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment