class LicenseRevisionComment(forms.Form):
COMMENT_REQUIRED_MAPPING = {
'editing': False,
'download': False,
'submit_to_approve': False,
'approve': False,
'reject': True,
'unsubmit': False,
'deliver': False,
'unapprove': False,
'deactivate': True,
'cancel': True
}
comment = forms.TextInput()
def __init__(self, trigger, *args, **kwargs):
super(LicenseRevisionComment, self).__init__(*args, **kwargs)
if self.is_comment_required(trigger):
self.fields['comment'].required = True
def is_comment_required(self, trigger):
return self.COMMENT_REQUIRED_MAPPING.get(trigger, False)
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.