1
have ma table with following information:
class Registro(db.Model):
id = db.Column(db.Integer, primary_key=True)
valores = db.Column(db.Float)
------------|
valores |
------------|
1.50 |
------------|
2.40 |
------------|
3.55 |
------------
@app.route('/', methods=['GET', 'POST'])
va = Registro.query.all()
def index():
return render_template('index.html', va=va)
wanted to sum these values and shows the result in the template. How would be the logic to achieve this result using flask-sqlalchemy?
Thanks Carlos I solved with your help
– Dalmo Cabral
Glad I could contribute.
– Carlos H Marques
Carlos does not want to abuse his patience because with his help I can resolve my doubt but another one has arisen. I did the same procedure in a table that contains hours in float that total result of that sum was 14.75 which is 14:47:24. Do you know any sqlalchemy instruction that can solve this FLOAT to hour conversion in "HH:MM format" ?
– Dalmo Cabral