Часть кода из models.py
class Incidents(db.Model): __tablename__ = 'incidents' uid = db.Column(db.Integer, primary_key = True) orgname = db.Column(db.String(100)) email = db.Column(db.String(120), unique = True) topic = db.Column(db.String(100)) body = db.Column(db.String(2000)) def __init__(self, orgname, email, topic, body): self.orgname = orgname.title() self.email = email.lower() self.topic = topic.title() self.body = body.title()
@app.route('/all') def show_all(): data = Incidents.query.all() return render_template('all.html', data=data)