From 21c35836d23aa66e43f68ec2e5194a28aa748470 Mon Sep 17 00:00:00 2001 From: Sawyer Bergeron Date: Fri, 31 May 2019 16:29:12 -0400 Subject: 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 --- src/workflow/forms.py | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to 'src/workflow/forms.py') 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) -- cgit 1.2.3-korg