コード例 #1
0
ファイル: forms.py プロジェクト: sherlockliu/mediagoblin
class EditAccountForm(wtforms.Form):
    wants_comment_notification = wtforms.BooleanField(
        description=_("Email me when others comment on my media"))
    wants_notifications = wtforms.BooleanField(
        description=_("Enable insite notifications about events."))
    license_preference = wtforms.SelectField(
        _('License preference'), [
            wtforms.validators.Optional(),
            wtforms.validators.AnyOf([lic[0]
                                      for lic in licenses_as_choices()]),
        ],
        choices=licenses_as_choices(),
        description=_('This will be your default license on upload forms.'))
コード例 #2
0
class EditAccountForm(wtforms.Form):
    new_email = wtforms.TextField(
        _('New email address'),
        [wtforms.validators.Optional(),
         normalize_user_or_email_field(allow_user=False)])
    wants_comment_notification = wtforms.BooleanField(
        description=_("Email me when others comment on my media"))
    license_preference = wtforms.SelectField(
        _('License preference'),
        [
            wtforms.validators.Optional(),
            wtforms.validators.AnyOf([lic[0] for lic in licenses_as_choices()]),
        ],
        choices=licenses_as_choices(),
        description=_('This will be your default license on upload forms.'))
コード例 #3
0
ファイル: forms.py プロジェクト: eliroca/mediagoblin-mirror
class BlogPostEditForm(wtforms.Form):
    title = wtforms.StringField(_('Title'),
                                [wtforms.validators.Length(min=0, max=500)])
    description = wtforms.TextAreaField(_('Description'))
    tags = wtforms.StringField(_('Tags'), [tag_length_validator],
                               description="Seperate tags by commas.")
    license = wtforms.SelectField(_('License'),
                                  [wtforms.validators.Optional()],
                                  choices=licenses_as_choices())
コード例 #4
0
ファイル: forms.py プロジェクト: orblivion/mediagoblin
 class SubmitStartForm(wtforms.Form):
     file = wtforms.FileField(_('File'), description=desc)
     title = wtforms.StringField(
         _('Title'), [wtforms.validators.Length(min=0, max=500)])
     description = wtforms.TextAreaField(_('Description of this work'),
                                         description=_("""You can use
                     <a href="http://daringfireball.net/projects/markdown/basics">
                     Markdown</a> for formatting."""))
     tags = wtforms.StringField(_('Tags'), [tag_length_validator],
                                description=_("Separate tags by commas."))
     license = wtforms.SelectField(_('License'), [
         wtforms.validators.Optional(),
     ],
                                   choices=licenses_as_choices())
     max_file_size = wtforms.HiddenField('')
     upload_limit = wtforms.HiddenField('')
     uploaded = wtforms.HiddenField('')
コード例 #5
0
ファイル: forms.py プロジェクト: sherlockliu/mediagoblin
class EditForm(wtforms.Form):
    title = wtforms.TextField(_('Title'),
                              [wtforms.validators.Length(min=0, max=500)])
    description = wtforms.TextAreaField(_('Description of this work'),
                                        description=_("""You can use
                      <a href="http://daringfireball.net/projects/markdown/basics">
                      Markdown</a> for formatting."""))
    tags = wtforms.TextField(_('Tags'), [tag_length_validator],
                             description=_("Separate tags by commas."))
    slug = wtforms.TextField(_('Slug'), [
        wtforms.validators.InputRequired(message=_("The slug can't be empty"))
    ],
                             description=_(
                                 "The title part of this media's address. "
                                 "You usually don't need to change this."))
    license = wtforms.SelectField(_('License'), [
        wtforms.validators.Optional(),
    ],
                                  choices=licenses_as_choices())
コード例 #6
0
class SubmitStartForm(wtforms.Form):
    file = wtforms.FileField(_('File'))
    title = wtforms.TextField(
        _('Title'),
        [wtforms.validators.Length(min=0, max=500)])
    description = wtforms.TextAreaField(
        _('Description of this work'),
        description=_("""You can use
                      <a href="http://daringfireball.net/projects/markdown/basics">
                      Markdown</a> for formatting."""))
    tags = wtforms.TextField(
        _('Tags'),
        [tag_length_validator],
        description=_(
          "Separate tags by commas."))
#    collection = QuerySelectField(
#        _('Collection'),
#        allow_blank=True, blank_text=_('-- Select --'), get_label='title',)
    license = wtforms.SelectField(
        _('License'),
        [wtforms.validators.Optional(),],
        choices=licenses_as_choices())