add id_for_file_path helper method for process groups
This commit is contained in:
parent
1d14ea5da5
commit
79dea88b96
|
@ -10,6 +10,8 @@ import marshmallow
|
|||
from marshmallow import post_load
|
||||
from marshmallow import Schema
|
||||
|
||||
import os
|
||||
|
||||
from spiffworkflow_backend.models.process_model import ProcessModelInfo
|
||||
|
||||
|
||||
|
@ -47,6 +49,11 @@ class ProcessGroup:
|
|||
original_dict = dataclasses.asdict(self)
|
||||
return {x: original_dict[x] for x in original_dict if x not in ["sort_index"]}
|
||||
|
||||
# for use with os.path.join, so it can work on windows
|
||||
def id_for_file_path(self) -> str:
|
||||
"""Id_for_file_path."""
|
||||
return self.id.replace("/", os.sep)
|
||||
|
||||
|
||||
class ProcessGroupSchema(Schema):
|
||||
"""ProcessGroupSchema."""
|
||||
|
|
Loading…
Reference in New Issue