poskusil uporabit datetime ampak ni lih ratalo, še feno ni tega

master
Kostanjevec 2022-06-05 21:19:20 +02:00
parent f8bae1331a
commit 0ed349e53d
2 changed files with 14 additions and 15 deletions

View File

@ -5,11 +5,11 @@ from csv import unregister_dialect
from sqlite3 import Date
from xmlrpc.client import Boolean
from click import password_option
from pymysql import Timestamp
from pymysql import Time, Timestamp
#from ssl import _PasswordType
#from xmlrpc.client import DateTime
#from matplotlib.pyplot import title
from sqlalchemy import Column, Integer, Float, String, Text, TIMESTAMP,ForeignKey, BOOLEAN
from sqlalchemy import Column, Integer, Float, String, Text, DateTime, ForeignKey, BOOLEAN
from sqlalchemy.ext.declarative import declarative_base
#from sqlalchemy.orm import relationship
from sqlalchemy import func, create_engine,join
@ -35,8 +35,8 @@ class Card(Base):
owner_id = Column(Integer, ForeignKey("user.id"), nullable=False)
interest_rate = Column(Float)
item_location = Column(String(1024))
#shared = Column(BOOLEAN) #tu bo že problem, ker
#last_review = Column(TIMESTAMP)
last_review = Column(Text)
#shared = Column(BOOLEAN) #tu bo že problem, ker mora imeti shared za vsakega svoj IR
class Deck(Base):
__tablename__ = 'deck'
@ -47,16 +47,15 @@ class Deck(Base):
current_card = Column(Integer)
completed = Column(BOOLEAN)
# shared = Column(Bool)
# item_type = Column(String)
# content_type = Column(String)
# item_size = Column(Integer)
#ali
# date_added = Column(String)
# last_review = Column(DateTime)
# interval = Column(Integer)
# due = Column(DateTime)
"""
class Review(Base):
__tablename__ = 'review'
id = Column(Integer, primary_key=True, autoincrement=True)
reviewer_id = Column(Integer, ForeignKey("user.id"), nullable=False)
card_id = Column(Integer, ForeignKey("user.id"), nullable=False)
review = Column(Text)
time = Column(DateTime)
"""
engine = create_engine(CONFIG['DB_CONNECTION'])

View File

@ -27,7 +27,7 @@ for item in l:
public_share = nc.share_file_with_link("/GIA CLOUD/"+name)
public_link = public_share.get_link()+"/download/"+name
card = Card(title=name, interest_rate=-1.0, owner_id=1, item_location=public_link)
card = Card(title=name, interest_rate=-1.0, owner_id=1, item_location=public_link, last_review=None)
dbsession.add(card)
dbsession.commit()