wtforms.fields.TextField was deprecated
WTForms documentation: > The TextField alias for StringField is deprecated. Signed-off-by: Berker Peksag <berker.peksag@gmail.com>
This commit is contained in:
parent
c8c09bc43b
commit
f4686cde16
@ -25,7 +25,7 @@ from mediagoblin.auth.tools import normalize_user_or_email_field
|
||||
|
||||
|
||||
class EditForm(wtforms.Form):
|
||||
title = wtforms.TextField(
|
||||
title = wtforms.StringField(
|
||||
_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
description = wtforms.TextAreaField(
|
||||
@ -33,12 +33,12 @@ class EditForm(wtforms.Form):
|
||||
description=_("""You can use
|
||||
<a href="http://daringfireball.net/projects/markdown/basics">
|
||||
Markdown</a> for formatting."""))
|
||||
tags = wtforms.TextField(
|
||||
tags = wtforms.StringField(
|
||||
_('Tags'),
|
||||
[tag_length_validator],
|
||||
description=_(
|
||||
"Separate tags by commas."))
|
||||
slug = wtforms.TextField(
|
||||
slug = wtforms.StringField(
|
||||
_('Slug'),
|
||||
[wtforms.validators.InputRequired(message=_("The slug can't be empty"))],
|
||||
description=_(
|
||||
@ -56,12 +56,12 @@ class EditProfileForm(wtforms.Form):
|
||||
description=_("""You can use
|
||||
<a href="http://daringfireball.net/projects/markdown/basics">
|
||||
Markdown</a> for formatting."""))
|
||||
url = wtforms.TextField(
|
||||
url = wtforms.StringField(
|
||||
_('Website'),
|
||||
[wtforms.validators.Optional(),
|
||||
wtforms.validators.URL(message=_("This address contains errors"))])
|
||||
|
||||
location = wtforms.TextField(_('Hometown'))
|
||||
location = wtforms.StringField(_('Hometown'))
|
||||
|
||||
class EditAccountForm(wtforms.Form):
|
||||
wants_comment_notification = wtforms.BooleanField(
|
||||
@ -79,14 +79,14 @@ class EditAccountForm(wtforms.Form):
|
||||
|
||||
|
||||
class EditAttachmentsForm(wtforms.Form):
|
||||
attachment_name = wtforms.TextField(
|
||||
attachment_name = wtforms.StringField(
|
||||
'Title')
|
||||
attachment_file = wtforms.FileField(
|
||||
'File')
|
||||
|
||||
|
||||
class EditCollectionForm(wtforms.Form):
|
||||
title = wtforms.TextField(
|
||||
title = wtforms.StringField(
|
||||
_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500), wtforms.validators.InputRequired(message=_("The title can't be empty"))])
|
||||
description = wtforms.TextAreaField(
|
||||
@ -94,7 +94,7 @@ class EditCollectionForm(wtforms.Form):
|
||||
description=_("""You can use
|
||||
<a href="http://daringfireball.net/projects/markdown/basics">
|
||||
Markdown</a> for formatting."""))
|
||||
slug = wtforms.TextField(
|
||||
slug = wtforms.StringField(
|
||||
_('Slug'),
|
||||
[wtforms.validators.InputRequired(message=_("The slug can't be empty"))],
|
||||
description=_(
|
||||
@ -116,7 +116,7 @@ class ChangePassForm(wtforms.Form):
|
||||
|
||||
|
||||
class ChangeEmailForm(wtforms.Form):
|
||||
new_email = wtforms.TextField(
|
||||
new_email = wtforms.StringField(
|
||||
_('New email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
@ -153,8 +153,8 @@ class MetaDataValidator(object):
|
||||
errors.pop())
|
||||
|
||||
class MetaDataForm(wtforms.Form):
|
||||
identifier = wtforms.TextField(_(u'Identifier'),[MetaDataValidator()])
|
||||
value = wtforms.TextField(_(u'Value'))
|
||||
identifier = wtforms.StringField(_(u'Identifier'),[MetaDataValidator()])
|
||||
value = wtforms.StringField(_(u'Value'))
|
||||
|
||||
class EditMetaDataForm(wtforms.Form):
|
||||
media_metadata = wtforms.FieldList(
|
||||
|
@ -21,26 +21,25 @@ from mediagoblin.tools.translate import lazy_pass_to_ugettext as _
|
||||
from mediagoblin.tools.licenses import licenses_as_choices
|
||||
|
||||
class BlogPostEditForm(wtforms.Form):
|
||||
title = wtforms.TextField(_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
title = wtforms.StringField(_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
description = wtforms.TextAreaField(_('Description'))
|
||||
tags = wtforms.TextField(_('Tags'), [tag_length_validator],
|
||||
description="Seperate tags by commas.")
|
||||
license = wtforms.SelectField(_('License'),
|
||||
[wtforms.validators.Optional(),], choices=licenses_as_choices())
|
||||
tags = wtforms.StringField(
|
||||
_('Tags'), [tag_length_validator],
|
||||
description="Seperate tags by commas."
|
||||
)
|
||||
license = wtforms.SelectField(
|
||||
_('License'),
|
||||
[wtforms.validators.Optional()],
|
||||
choices=licenses_as_choices()
|
||||
)
|
||||
|
||||
class BlogEditForm(wtforms.Form):
|
||||
title = wtforms.TextField(_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
title = wtforms.StringField(_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
description = wtforms.TextAreaField(_('Description'))
|
||||
|
||||
|
||||
class ConfirmDeleteForm(wtforms.Form):
|
||||
confirm = wtforms.BooleanField(
|
||||
_('I am sure I want to delete this'))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ from mediagoblin.auth.tools import normalize_user_or_email_field
|
||||
|
||||
|
||||
class RegistrationForm(wtforms.Form):
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_email=False)])
|
||||
@ -28,14 +28,14 @@ class RegistrationForm(wtforms.Form):
|
||||
_('Password'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
wtforms.validators.Length(min=5, max=1024)])
|
||||
email = wtforms.TextField(
|
||||
email = wtforms.StringField(
|
||||
_('Email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
|
||||
|
||||
class LoginForm(wtforms.Form):
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username or Email'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field()])
|
||||
@ -47,7 +47,7 @@ class LoginForm(wtforms.Form):
|
||||
|
||||
|
||||
class ForgotPassForm(wtforms.Form):
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username or email'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field()])
|
||||
|
@ -24,14 +24,14 @@ class RegisterForm(wtforms.Form):
|
||||
'',
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_email=False)])
|
||||
email = wtforms.TextField(
|
||||
email = wtforms.StringField(
|
||||
_('Email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
|
||||
|
||||
class LoginForm(wtforms.Form):
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field()])
|
||||
|
@ -23,18 +23,18 @@ class RegistrationForm(wtforms.Form):
|
||||
openid = wtforms.HiddenField(
|
||||
'',
|
||||
[wtforms.validators.InputRequired()])
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_email=False)])
|
||||
email = wtforms.TextField(
|
||||
email = wtforms.StringField(
|
||||
_('Email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
|
||||
|
||||
class LoginForm(wtforms.Form):
|
||||
openid = wtforms.TextField(
|
||||
openid = wtforms.StringField(
|
||||
_('OpenID'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
# Can openid's only be urls?
|
||||
|
@ -20,11 +20,11 @@ from mediagoblin.auth.tools import normalize_user_or_email_field
|
||||
|
||||
|
||||
class RegistrationForm(wtforms.Form):
|
||||
username = wtforms.TextField(
|
||||
username = wtforms.StringField(
|
||||
_('Username'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_email=False)])
|
||||
email = wtforms.TextField(
|
||||
email = wtforms.StringField(
|
||||
_('Email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
@ -35,7 +35,7 @@ class RegistrationForm(wtforms.Form):
|
||||
|
||||
|
||||
class EditForm(wtforms.Form):
|
||||
email = wtforms.TextField(
|
||||
email = wtforms.StringField(
|
||||
_('Email address'),
|
||||
[wtforms.validators.InputRequired(),
|
||||
normalize_user_or_email_field(allow_user=False)])
|
||||
|
@ -20,10 +20,10 @@ import wtforms
|
||||
|
||||
class AddSimpleForm(wtforms.Form):
|
||||
image = wtforms.FileField()
|
||||
name = wtforms.TextField(
|
||||
name = wtforms.StringField(
|
||||
validators=[wtforms.validators.Length(min=0, max=500)])
|
||||
comment = wtforms.TextField()
|
||||
# tags = wtforms.FieldList(wtforms.TextField())
|
||||
comment = wtforms.StringField()
|
||||
# tags = wtforms.FieldList(wtforms.StringField())
|
||||
category = wtforms.IntegerField()
|
||||
level = wtforms.IntegerField()
|
||||
|
||||
@ -32,13 +32,13 @@ _md5_validator = wtforms.validators.Regexp(r"^[0-9a-fA-F]{32}$")
|
||||
|
||||
|
||||
class AddForm(wtforms.Form):
|
||||
original_sum = wtforms.TextField(None,
|
||||
original_sum = wtforms.StringField(None,
|
||||
[_md5_validator,
|
||||
wtforms.validators.InputRequired()])
|
||||
thumbnail_sum = wtforms.TextField(None,
|
||||
thumbnail_sum = wtforms.StringField(None,
|
||||
[wtforms.validators.Optional(),
|
||||
_md5_validator])
|
||||
file_sum = wtforms.TextField(None, [_md5_validator])
|
||||
name = wtforms.TextField()
|
||||
date_creation = wtforms.TextField()
|
||||
categories = wtforms.TextField()
|
||||
file_sum = wtforms.StringField(None, [_md5_validator])
|
||||
name = wtforms.StringField()
|
||||
date_creation = wtforms.StringField()
|
||||
categories = wtforms.StringField()
|
||||
|
@ -33,7 +33,7 @@ def get_submit_start_form(form, **kwargs):
|
||||
file = wtforms.FileField(
|
||||
_('File'),
|
||||
description=desc)
|
||||
title = wtforms.TextField(
|
||||
title = wtforms.StringField(
|
||||
_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
description = wtforms.TextAreaField(
|
||||
@ -41,7 +41,7 @@ def get_submit_start_form(form, **kwargs):
|
||||
description=_("""You can use
|
||||
<a href="http://daringfireball.net/projects/markdown/basics">
|
||||
Markdown</a> for formatting."""))
|
||||
tags = wtforms.TextField(
|
||||
tags = wtforms.StringField(
|
||||
_('Tags'),
|
||||
[tag_length_validator],
|
||||
description=_(
|
||||
@ -57,7 +57,7 @@ def get_submit_start_form(form, **kwargs):
|
||||
return SubmitStartForm(form, **kwargs)
|
||||
|
||||
class AddCollectionForm(wtforms.Form):
|
||||
title = wtforms.TextField(
|
||||
title = wtforms.StringField(
|
||||
_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500), wtforms.validators.InputRequired()])
|
||||
description = wtforms.TextAreaField(
|
||||
|
@ -41,7 +41,7 @@ class MediaCollectForm(wtforms.Form):
|
||||
note = wtforms.TextAreaField(
|
||||
_('Include a note'),
|
||||
[wtforms.validators.Optional()],)
|
||||
collection_title = wtforms.TextField(
|
||||
collection_title = wtforms.StringField(
|
||||
_('Title'),
|
||||
[wtforms.validators.Length(min=0, max=500)])
|
||||
collection_description = wtforms.TextAreaField(
|
||||
|
Loading…
x
Reference in New Issue
Block a user