def build_upload_html_form(project):
 attrs = {'project': project}
 active = project.versions.public()
 if active.exists():
  choices = []
  choices += [(version.slug, version.verbose_name) for version in active]
  attrs['version'] = forms.ChoiceField(label=_('Version of the project you are uploading HTML for'), choices=choices)
 return type('UploadHTMLForm', (BaseUploadHTMLForm,), attrs)

def build_upload_html_form ( project ) : attrs = { 'project' : project } active = project . versions . public ( ) if active . exists ( ) : choices = [ ] choices += [ ( version . slug , version . verbose_name ) for version in active ] attrs [ 'version' ] = forms . ChoiceField ( label = _ ( 'Version of the project you are uploading HTML for' ) , choices = choices ) return type ( 'UploadHTMLForm' , ( BaseUploadHTMLForm , ) , attrs )
upload html form with list of versions to upload html for .