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