aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/forms.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2019-05-31 16:29:12 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2019-06-04 12:39:24 -0400
commit21c35836d23aa66e43f68ec2e5194a28aa748470 (patch)
tree5d31fbe8b6f5abb69c0ea956f69c6ef0116b4837 /src/workflow/forms.py
parentbe541f2ae9e8415a156f3dc7f6796e7c90749181 (diff)
Integrate OPNFV workflow
Now that required groundwork is in place, we can start to pull the OPNFV workflow into the booking workflow Change-Id: Ifa026ad446b48356ae03ef1d5ad48db841e13fbd Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/workflow/forms.py')
-rw-r--r--src/workflow/forms.py40
1 files changed, 28 insertions, 12 deletions
diff --git a/src/workflow/forms.py b/src/workflow/forms.py
index ea484da..bd2d14a 100644
--- a/src/workflow/forms.py
+++ b/src/workflow/forms.py
@@ -172,12 +172,27 @@ class SWConfigSelectorForm(SearchableSelectAbstractForm):
items = {}
for bundle in queryset:
- item = {}
- item['small_name'] = bundle.name
- item['expanded_name'] = bundle.owner.username
- item['string'] = bundle.description
- item['id'] = bundle.id
- items[bundle.id] = item
+ items[bundle.id] = {
+ 'small_name': bundle.name,
+ 'expanded_name': bundle.owner.username,
+ 'string': bundle.description,
+ 'id': bundle.id
+ }
+
+ return items
+
+
+class OPNFVSelectForm(SearchableSelectAbstractForm):
+ def generate_items(self, queryset):
+ items = {}
+
+ for config in queryset:
+ items[config.id] = {
+ 'small_name': config.name,
+ 'expanded_name': config.bundle.owner.username,
+ 'string': config.description,
+ 'id': config.id
+ }
return items
@@ -187,12 +202,12 @@ class ResourceSelectorForm(SearchableSelectAbstractForm):
items = {}
for bundle in queryset:
- item = {}
- item['small_name'] = bundle.name
- item['expanded_name'] = bundle.owner.username
- item['string'] = bundle.description
- item['id'] = bundle.id
- items[bundle.id] = item
+ items[bundle.id] = {
+ 'small_name': bundle.name,
+ 'expanded_name': bundle.owner.username,
+ 'string': bundle.description,
+ 'id': bundle.id
+ }
return items
@@ -212,6 +227,7 @@ class BookingMetaForm(forms.Form):
purpose = forms.CharField(max_length=1000)
project = forms.CharField(max_length=400)
info_file = forms.CharField(max_length=1000, required=False)
+ deploy_opnfv = forms.BooleanField(required=False)
def __init__(self, *args, user_initial=[], owner=None, **kwargs):
super(BookingMetaForm, self).__init__(**kwargs)