diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-10-11 01:41:20 +0200 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2016-01-26 23:46:30 +0100 |
commit | f81d231465e7a3d7b4f434f266a5a733fa45ec9b (patch) | |
tree | be94ce9383fa7beeff162d8cbd7f7b8751816576 /src/web/forms.py | |
parent | base category creation/edition (diff) | |
download | newspipe-f81d231465e7a3d7b4f434f266a5a733fa45ec9b.tar.gz newspipe-f81d231465e7a3d7b4f434f266a5a733fa45ec9b.tar.bz2 newspipe-f81d231465e7a3d7b4f434f266a5a733fa45ec9b.zip |
assigning categories to feeds and articles
Diffstat (limited to 'src/web/forms.py')
-rw-r--r-- | src/web/forms.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/web/forms.py b/src/web/forms.py index d901f260..f57b31d0 100644 --- a/src/web/forms.py +++ b/src/web/forms.py @@ -31,7 +31,7 @@ from flask import flash, url_for, redirect from flask.ext.wtf import Form from flask.ext.babel import lazy_gettext from wtforms import TextField, TextAreaField, PasswordField, BooleanField, \ - SubmitField, IntegerField, validators, HiddenField + SubmitField, IntegerField, SelectField, validators, HiddenField from flask.ext.wtf.html5 import EmailField from flask_wtf import RecaptchaField @@ -170,6 +170,13 @@ class AddFeedForm(Form): site_link = TextField(lazy_gettext("Site link"), [validators.Optional()]) enabled = BooleanField(lazy_gettext("Check for updates"), default=True) submit = SubmitField(lazy_gettext("Save")) + category_id = SelectField(lazy_gettext("Category of the feed"), + [validators.Optional()]) + + def set_category_choices(self, categories): + self.category_id.choices = [('0', 'No Category')] + self.category_id.choices += [(str(cat.id), cat.name) + for cat in categories] class AddCategoryForm(Form): |