diff --git a/src/spiffworkflow_backend/models/process_group.py b/src/spiffworkflow_backend/models/process_group.py index 083e0d39..b87530ff 100644 --- a/src/spiffworkflow_backend/models/process_group.py +++ b/src/spiffworkflow_backend/models/process_group.py @@ -1,29 +1,26 @@ """Process_group.""" from marshmallow import post_load from marshmallow import Schema - - -# class ProcessGroupModel(db.Model): # type: ignore -# """ProcessGroupMode.""" -# -# __tablename__ = "process_group" -# id = db.Column(db.Integer, primary_key=True) -# name = db.Column(db.String(50)) +import marshmallow class ProcessGroup: """ProcessGroup.""" - def __init__(self, id, display_name, display_order=0, admin=False): + def __init__(self, id, display_name, display_order=0, admin=False, process_models=None): """__init__.""" self.id = id # A unique string name, lower case, under scores (ie, 'my_group') self.display_name = display_name self.display_order = display_order self.admin = admin self.workflows = [] # For storing Workflow Metadata - self.specs = [] # For the list of specifications associated with a group self.meta = None # For storing group metadata + if process_models is None: + process_models = [] + + self.process_models = process_models # For the list of specifications associated with a group + def __eq__(self, other): """__eq__.""" if not isinstance(other, ProcessGroup): @@ -40,7 +37,11 @@ class ProcessGroupSchema(Schema): """Meta.""" model = ProcessGroup - fields = ["id", "display_name", "display_order", "admin"] + fields = ["id", "display_name", "display_order", "admin", "process_models"] + + process_models = marshmallow.fields.List( + marshmallow.fields.Nested("ProcessModelInfoSchema", dump_only=True, required=False) + ) @post_load def make_cat(self, data, **kwargs): diff --git a/src/spiffworkflow_backend/routes/admin_blueprint/templates/process_group_show.html b/src/spiffworkflow_backend/routes/admin_blueprint/templates/process_group_show.html index 0360d5ad..a41ea333 100644 --- a/src/spiffworkflow_backend/routes/admin_blueprint/templates/process_group_show.html +++ b/src/spiffworkflow_backend/routes/admin_blueprint/templates/process_group_show.html @@ -1,5 +1,6 @@ -{% extends "layout.html" %} {% block title %}Process Group: {{ process_group.id -}}{% endblock %} {% block content %} +{% extends "layout.html" %} +{% block title %}Process Group: {{ process_group.id }}{% endblock %} +{% block content %}