Merge pull request #516 from dod-ccpo/multicheckbox_with_other

Multicheckbox with 'other' option
This commit is contained in:
montana-mil
2019-01-07 10:13:31 -05:00
committed by GitHub
10 changed files with 185 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ from wtforms.fields import (
TextAreaField,
)
from wtforms.fields.html5 import DateField
from wtforms.widgets import ListWidget, CheckboxInput
from .forms import CacheableForm
from .data import (
@@ -46,6 +47,8 @@ class AppInfoForm(CacheableForm):
description="Which of these describes how complex your team's use of the cloud will be? (Select all that apply.)",
choices=PROJECT_COMPLEXITY,
default="",
widget=ListWidget(prefix_label=False),
option_widget=CheckboxInput(),
)
complexity_other = StringField("Project Complexity Other")
dev_team = SelectMultipleField(
@@ -53,6 +56,8 @@ class AppInfoForm(CacheableForm):
description="Which people or teams will be completing the development work for your cloud applications?",
choices=DEV_TEAM,
default="",
widget=ListWidget(prefix_label=False),
option_widget=CheckboxInput(),
)
dev_team_other = StringField("Development Team Other")
team_experience = RadioField(

View File

@@ -52,11 +52,6 @@ class TaskOrder(Base, mixins.TimestampsMixin):
filter(None, [self.clin_01, self.clin_02, self.clin_03, self.clin_04])
)
def __repr__(self):
return "<TaskOrder(number='{}', budget='{}', end_date='{}', id='{}')>".format(
self.number, self.budget, self.end_date, self.id
)
@property
def portfolio_name(self):
return self.workspace.name
@@ -70,3 +65,8 @@ class TaskOrder(Base, mixins.TimestampsMixin):
if c.name not in ["id"]
},
}
def __repr__(self):
return "<TaskOrder(number='{}', budget='{}', end_date='{}', id='{}')>".format(
self.number, self.budget, self.end_date, self.id
)

View File

@@ -49,12 +49,20 @@ class ShowTaskOrderWorkflow:
return self._task_order
@property
def task_order_formdata(self):
task_order_dict = self.task_order.to_dictionary()
for field in task_order_dict:
if task_order_dict[field] is None:
task_order_dict[field] = ""
return task_order_dict
@property
def form(self):
if self._form:
pass
elif self.task_order:
self._form = self._section["form"](data=self.task_order.to_dictionary())
self._form = self._section["form"](formdata=self.task_order_formdata)
else:
self._form = self._section["form"]()