diff --git a/blender-bfct/application/controllers/main.py b/blender-bfct/application/controllers/main.py index 7130e1f..250d51a 100644 --- a/blender-bfct/application/controllers/main.py +++ b/blender-bfct/application/controllers/main.py @@ -18,6 +18,7 @@ class ApplicationForm(Form): website = URLField(validators=[url()]) city_country = TextField('City and Country', validators=[DataRequired()]) teaching = BooleanField('Teaching') + institution_name = TextField('School or institution name') skills = SelectMultipleField('Areas of expertise', coerce=int) video_example = URLField(validators=[url()]) written_example = URLField(validators=[url()]) diff --git a/blender-bfct/application/models/applications.py b/blender-bfct/application/models/applications.py index c38057b..9008c26 100644 --- a/blender-bfct/application/models/applications.py +++ b/blender-bfct/application/models/applications.py @@ -15,7 +15,7 @@ class Application(db.Model): network_profile = db.Column(db.String(255)) website = db.Column(db.String(255)) city_country = db.Column(db.String(255)) - teaching = db.Column(db.Boolean()) + institution_name = db.Column(db.String(255)) skills = db.relationship('Skill', secondary='skills_applications', backref=db.backref('applications', lazy='dynamic')) video_example = db.Column(db.String(255)) @@ -41,10 +41,15 @@ class Application(db.Model): return '--' + class Skill(db.Model): id = db.Column(db.Integer(), primary_key=True) name = db.Column(db.String(80), unique=True) description = db.Column(db.String(255)) + + def __str__(self): + return self.name + skills_applications = db.Table('skills_applications', diff --git a/blender-bfct/application/models/users.py b/blender-bfct/application/models/users.py index c842e18..60a7aa0 100644 --- a/blender-bfct/application/models/users.py +++ b/blender-bfct/application/models/users.py @@ -18,6 +18,10 @@ class User(db.Model, UserMixin): roles = db.relationship('Role', secondary='roles_users', backref=db.backref('users', lazy='dynamic')) + def __str__(self): + return self.email + + class Role(db.Model, RoleMixin): __bind_key__ = 'users' id = db.Column(db.Integer(), primary_key=True) diff --git a/blender-bfct/application/templates/apply.html b/blender-bfct/application/templates/apply.html index 2d5923d..c91bb4e 100755 --- a/blender-bfct/application/templates/apply.html +++ b/blender-bfct/application/templates/apply.html @@ -33,6 +33,13 @@ + + + Institution Name + {{ form.institution_name(class='form-control', placeholder='School or institution name') }} + + + Areas of expertise