added share_id to db and new cards

master
Kostanjevec 2022-06-08 21:13:45 +02:00
parent 3f1a25ee00
commit 05e513aba5
3 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ class Card(Base):
interest_rate = Column(Float)
item_location = Column(String(1024))
last_review = Column(Text)
#shared = Column(BOOLEAN) #tu bo že problem, ker mora imeti shared za vsakega svoj IR
share_id = Column(Integer) #explain: 0 means not shared, otherwise increment from db and generate new cards for all relevant(tbd) users
class Deck(Base):
__tablename__ = 'deck'

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, last_review=None)
card = Card(title=name, interest_rate=-1.0, owner_id=1, item_location=public_link, last_review=None, share_id=0)
dbsession.add(card)
dbsession.commit()

View File

@ -57,7 +57,7 @@ def upload_file():
public_link = nc.share_file_with_link("/GIA CLOUD/" + filename).get_link()+"/download/"+filename
#add card
card = Card(title=filename, interest_rate=-1.0, owner_id=user_id, item_location=public_link, last_review=None)
card = Card(title=filename, interest_rate=-1.0, owner_id=user_id, item_location=public_link, last_review=None, share_id=0)
dbsession.add(card)
dbsession.commit()