-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforms.py
More file actions
44 lines (27 loc) · 1.39 KB
/
Copy pathforms.py
File metadata and controls
44 lines (27 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""Forms for playlist app."""
from wtforms import SelectField
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, SelectField, TextAreaField, BooleanField, PasswordField
from wtforms.validators import InputRequired, Length, NumberRange, URL, Optional
class RegisterForm(FlaskForm):
"""Form for registering a user."""
username = StringField("Username", validators=[InputRequired()])
password = PasswordField("Password", validators=[InputRequired()])
class LoginForm(FlaskForm):
"""Form for registering a user."""
username = StringField("Username", validators=[InputRequired()])
password = PasswordField("Password", validators=[InputRequired()])
class PlaylistForm(FlaskForm):
"""Form for adding playlists."""
# Add the necessary code to use this form
name = StringField("Playlist Name", validators=[InputRequired()])
# description = StringField('Playlist Description', validators=[InputRequired()])
class SongForm(FlaskForm):
"""Form for adding songs."""
# Add the necessary code to use this form
title = StringField("Song Title", validators=[InputRequired()] )
artist = StringField("Artist Name", validators=[InputRequired()] )
# DO NOT MODIFY THIS FORM - EVERYTHING YOU NEED IS HERE
class NewSongForPlaylistForm(FlaskForm):
"""Form for adding a song to playlist."""
song = SelectField('Song To Add', coerce=int)