Next, we define a NameForm class that works with booksomeplace.entity.base.Name. In this class, we first create an instance of booksomeplace.domain.common.CommonService in order to retrieve values for titles (Mr, Ms, and so on). You see that we also implement RegexValidator for first and last names:
class NameForm(forms.Form) :
config = Config()
commonSvc = CommonService(config)
titles = [(item, item) for item in commonSvc.fetchByKey('title')]
alphaOnly = RegexValidator(r'^[a-zA-Z]*$', 'Only letters allowed.')
name_title = forms.ChoiceField(label='Title',choices=titles)
name_first = forms.CharField(label='First Name', \
validators=[alphaOnly])
name_middle= forms.CharField(label='M.I.',required=False)
name_last = forms.CharField(label='Last Name',validators=[alphaOnly])
name_suffix= forms.CharField(label...