Make app views static methods #24

Merged
gergely merged 1 commits from static-app-views into master 2018-07-03 08:27:18 +00:00
1 changed files with 6 additions and 3 deletions

View File

@ -106,8 +106,9 @@ class CalendarSocialApp(Flask):
self.route(*args, **kwargs)(attr)
@staticmethod
@route('/')
def hello(self):
def hello():
"""View for the main page
This will display a welcome message for users not logged in; for others, their main
@ -128,8 +129,9 @@ class CalendarSocialApp(Flask):
return render_template('index.html', calendar=calendar)
@staticmethod
@route('/register', methods=['POST', 'GET'])
def register(self):
def register():
"""View for user registration
If the ``REGISTRATION_FAILED`` configuration value is set to ``True`` it displays the
@ -156,9 +158,10 @@ class CalendarSocialApp(Flask):
return render_template('registration.html', form=form)
@staticmethod
@route('/new-event', methods=['GET', 'POST'])
@login_required
def new_event(self):
def new_event():
"""View for creating a new event
This presents a form to the user that allows entering event details.