aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/forms.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-11-01 15:33:36 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-11-01 15:33:36 +0100
commit6cc4bfdf8d67029b5038693dc99c27e669d0234c (patch)
tree8f379e249007cd753d291b44013b581b13881c6b /pyaggr3g470r/forms.py
parentAdded users management. (diff)
downloadnewspipe-6cc4bfdf8d67029b5038693dc99c27e669d0234c.tar.gz
newspipe-6cc4bfdf8d67029b5038693dc99c27e669d0234c.tar.bz2
newspipe-6cc4bfdf8d67029b5038693dc99c27e669d0234c.zip
It is now possible to add a feed via a form for different users.
Diffstat (limited to 'pyaggr3g470r/forms.py')
-rw-r--r--pyaggr3g470r/forms.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py
index c7054b85..45d88e7f 100644
--- a/pyaggr3g470r/forms.py
+++ b/pyaggr3g470r/forms.py
@@ -23,4 +23,18 @@ class SigninForm(Form):
return True
else:
self.email.errors.append("Invalid e-mail or password")
- return False \ No newline at end of file
+ return False
+
+class AddFeedForm(Form):
+ title = TextField("Title", [validators.Required("Please enter a title.")])
+ link = TextField("Feed link", [validators.Required("Please enter a link.")])
+ site_link = TextField("Site link", [validators.Required("Please enter a site URL.")])
+ submit = SubmitField("Add feed")
+
+ def __init__(self, *args, **kwargs):
+ Form.__init__(self, *args, **kwargs)
+
+ def validate(self):
+ if not Form.validate(self):
+ return False
+ return True \ No newline at end of file
bgstack15