|
@@ -89,6 +89,10 @@ class Participant(db.Model):
|
|
|
name = db.Column(db.String)
|
|
|
# Mostly free-form (nick, mail address, ...)
|
|
|
contact = db.Column(db.String)
|
|
|
+ # Optional
|
|
|
+ country = db.Column(db.String)
|
|
|
+ # Free-form (peering technology, DSL or fiber, etc)
|
|
|
+ comment = db.Column(db.String)
|
|
|
# Whether we accept this participant or not
|
|
|
active = db.Column(db.Boolean)
|
|
|
# Many-to-many relationship
|
|
@@ -97,10 +101,12 @@ class Participant(db.Model):
|
|
|
backref=db.backref('participants', lazy='dynamic'),
|
|
|
lazy='dynamic')
|
|
|
|
|
|
- def __init__(self, name, contact):
|
|
|
+ def __init__(self, name, contact, country, comment):
|
|
|
self.uuid = str(uuid4())
|
|
|
self.name = name
|
|
|
self.contact = contact
|
|
|
+ self.country = country
|
|
|
+ self.comment = comment
|
|
|
self.active = False
|
|
|
|
|
|
def __str__(self):
|
|
@@ -199,8 +205,9 @@ def submit_job():
|
|
|
|
|
|
@app.route('/create/participant', methods=['POST'])
|
|
|
def create_participant():
|
|
|
- if {'name', 'contact'}.issubset(request.form) and request.form['name']:
|
|
|
- participant = Participant(request.form['name'], request.form['contact'])
|
|
|
+ fields = ['name', 'contact', 'country', 'comment']
|
|
|
+ if set(fields).issubset(request.form) and request.form['name']:
|
|
|
+ participant = Participant(*(request.form[f] for f in fields))
|
|
|
db.session.add(participant)
|
|
|
db.session.commit()
|
|
|
return render_template('participant.html', participant=participant,
|