exceldb/main.py

21 lines
513 B
Python

from models import TestModel, Test1Model
from exceldb import ExcelDB
edb = ExcelDB("./testdata/data.xlsx")
# edb.create_tables([TestModel, Test1Model])
TestModel.Meta.database = edb
# test1 = TestModel(username='Cool Hacker', datum='2023-11-12', test="Alex")
# test1.create()
#test1.delete()
# test1.username = "Very cool Hacker"
Test1Model.Meta.database = edb
Test1Model(username="Natusik", nickname='Barabusik', creater='Alex').create()
for t1 in edb.read(Test1Model):
print(t1.username, t1.creater)