0
Hey, guys. All right?
I started learning programming some time ago and took advantage of this quarantine to give a gas and manage to create my first system - a voucher/advance manager. It’s simple, the person requests a voucher with a certain value and then, on Dashboard, all the vouchers requested by that person and the amount of her salary updated appears.
It turns out now I’m trying to make an improvement that I don’t know where to start. I want the person to select a month of the year and all vouchers requested in that selected month appear.
I know it’s a simple question, but I thought about it anyway and I didn’t get an answer. If you can help me I really appreciate it!
For the record, I’m using python and flask with Blueprints and sqlalchemy.
With what I have now I can display all the vouchers requested by the user in this way in the view:
@core.route('/dashboard')
@login_required
def dashboard():
vales = Withdrawals.query.filter_by(solicitante = current_user)
total_vales = 0
total_qt_vales = 0
for vale in vales:
total_vales = total_vales + vale.value
total_qt_vales = total_qt_vales + 1
salario_total = current_user.salary - total_vales
return render_template('dashboard.html', vales=vales, salario_total=salario_total, total_qt_vales=total_qt_vales)
Thank you very much! I know you may have missed several details, but your answer gave me a great idea that I think will work.
– Luan Galvão
No problem brother, anything only talk, if you can give an up on the answer too , hugs
– Erick Kokubum
Oops! I already gave up here but as my rep is low does not appear :/ kk
– Luan Galvão