Compare commits
2 Commits
91ae04a924
...
4cbd21b2af
Author | SHA1 | Date |
---|---|---|
Kostanjevec | 4cbd21b2af | |
Kostanjevec | c5d71802ac |
33
create_db.py
33
create_db.py
|
@ -3,11 +3,13 @@
|
||||||
from csv import unregister_dialect
|
from csv import unregister_dialect
|
||||||
#import email
|
#import email
|
||||||
from sqlite3 import Date
|
from sqlite3 import Date
|
||||||
|
from xmlrpc.client import Boolean
|
||||||
from click import password_option
|
from click import password_option
|
||||||
|
from pymysql import Timestamp
|
||||||
#from ssl import _PasswordType
|
#from ssl import _PasswordType
|
||||||
#from xmlrpc.client import DateTime
|
#from xmlrpc.client import DateTime
|
||||||
#from matplotlib.pyplot import title
|
#from matplotlib.pyplot import title
|
||||||
from sqlalchemy import Column, Integer, Float, String, Text, TIMESTAMP,ForeignKey
|
from sqlalchemy import Column, Integer, Float, String, Text, TIMESTAMP,ForeignKey, BOOLEAN
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
#from sqlalchemy.orm import relationship
|
#from sqlalchemy.orm import relationship
|
||||||
from sqlalchemy import func, create_engine,join
|
from sqlalchemy import func, create_engine,join
|
||||||
|
@ -33,6 +35,17 @@ class Card(Base):
|
||||||
owner_id = Column(Integer, ForeignKey("user.id"), nullable=False)
|
owner_id = Column(Integer, ForeignKey("user.id"), nullable=False)
|
||||||
interest_rate = Column(Float)
|
interest_rate = Column(Float)
|
||||||
item_location = Column(String(1024))
|
item_location = Column(String(1024))
|
||||||
|
#shared = Column(BOOLEAN) #tu bo že problem, ker
|
||||||
|
#last_review = Column(TIMESTAMP)
|
||||||
|
|
||||||
|
class Deck(Base):
|
||||||
|
__tablename__ = 'deck'
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
cards_by_id = Column(Text)
|
||||||
|
number_of_cards = Column(Integer)
|
||||||
|
current_card = Column(Integer)
|
||||||
|
completed = Column(BOOLEAN)
|
||||||
|
|
||||||
|
|
||||||
# shared = Column(Bool)
|
# shared = Column(Bool)
|
||||||
# item_type = Column(String)
|
# item_type = Column(String)
|
||||||
|
@ -44,24 +57,6 @@ class Card(Base):
|
||||||
# interval = Column(Integer)
|
# interval = Column(Integer)
|
||||||
# due = Column(DateTime)
|
# due = Column(DateTime)
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
class Card(Base):
|
|
||||||
item_id = None
|
|
||||||
user_id = None
|
|
||||||
deck_id = None # generated session id
|
|
||||||
timestamp = None
|
|
||||||
interest_rate = Column(Float)
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
engine = create_engine(CONFIG['DB_CONNECTION'])
|
engine = create_engine(CONFIG['DB_CONNECTION'])
|
||||||
|
|
||||||
Base.metadata.create_all(engine)
|
Base.metadata.create_all(engine)
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
<canvas id="pdf-doc"></canvas>
|
<canvas id="pdf-doc"></canvas>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<button input type="submit" name="rate" data-cardtitle=card[title] value="Yes">Yes</button>
|
<button input type="submit" name="rate" data-cardtitle=card[title] value="Yes" accesskey="1">Yes</button> <!--ti keyi so alt+shit+key...-->
|
||||||
<button input type="submit" name="rate" value="Maybe">Maybe</button>
|
<button input type="submit" name="rate" value="Maybe" accesskey="2">Maybe</button>
|
||||||
<button input type="submit" name="rate" value="No">No</button>
|
<button input type="submit" name="rate" value="No" accesskey="3">No</button>
|
||||||
</form>
|
</form>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue