datetime problemi...

master
Kostanjevec 2022-06-05 21:20:23 +02:00
parent 0ed349e53d
commit a4f8c0aa8e
1 changed files with 6 additions and 6 deletions

12
app.py
View File

@ -1,17 +1,16 @@
from collections import UserList
import os
from flask import Flask, redirect, render_template, session, request, url_for
from datetime import date
from sqlalchemy import case
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from auth import login_required, bp as auth_bp
from deck import bp as deck_bp
from menu import bp as menu_bp
from upload import bp as upload_bp
from flask import Flask, redirect, render_template, session, request, url_for
from create_db import Card, Deck
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from config import CONFIG
from get_public_links import test_file
@ -86,7 +85,8 @@ def create_app(test_config=None):
elif rate == "No":
k = 0.1
dbsession.query(Card).filter(Card.id == card.id).update({'interest_rate': abs(card.interest_rate*k)})
dbsession.query(Card).filter(Card.id == card.id).update({'last_review': date()})
dbsession.query(Deck).filter(Deck.owner_id == user_id, Deck.id == deck_id).update({'current_card': current_card+1})
dbsession.commit()
return render_template("deck/index.html", username=username, card = card) # no idea kaj se tu dogaja...