diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-05-26 09:06:38 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-05-26 09:06:38 +0200 |
commit | a5b61c59da8d462836abf3178240675dd7156938 (patch) | |
tree | c7d8f3449862c37689e884480ca8f0ec29a47c4c /src/web/forms.py | |
parent | Updated translations. (diff) | |
download | newspipe-a5b61c59da8d462836abf3178240675dd7156938.tar.gz newspipe-a5b61c59da8d462836abf3178240675dd7156938.tar.bz2 newspipe-a5b61c59da8d462836abf3178240675dd7156938.zip |
Improved bookmark creation/edition form.
Diffstat (limited to 'src/web/forms.py')
-rw-r--r-- | src/web/forms.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/web/forms.py b/src/web/forms.py index 4d44f379..b7a92519 100644 --- a/src/web/forms.py +++ b/src/web/forms.py @@ -205,9 +205,13 @@ class CategoryForm(Form): class BookmarkForm(Form): - href = TextField(lazy_gettext("URL")) - title = TextField(lazy_gettext("Title")) - description = TextField(lazy_gettext("Description")) + href = TextField(lazy_gettext("URL"), + [validators.Required( + lazy_gettext("Please enter an URL."))]) + title = TextField(lazy_gettext("Title"), + [validators.Length(min=0, max=100)]) + description = TextField(lazy_gettext("Description"), + [validators.Length(min=0, max=500)]) tags = TextField(lazy_gettext("Tags")) to_read = BooleanField(lazy_gettext("To read"), default=False) shared = BooleanField(lazy_gettext("Shared"), default=False) |