Added first version of database and orm

This commit is contained in:
2020-12-11 21:48:46 +01:00
parent ee60be9880
commit 03ba1d1847
17 changed files with 183 additions and 20 deletions

14
src/tests_dev/db/city.py Normal file
View File

@@ -0,0 +1,14 @@
from sqlalchemy import Column, Integer, String
from sh_edraft.database.model import DBModel
class City(DBModel):
__tablename__ = 'Cities'
Id = Column(Integer, primary_key=True, nullable=False, autoincrement=True)
Name = Column(String(64), nullable=False)
ZIP = Column(String(5), nullable=False)
def __init__(self, name: str, zip_code: str):
self.Name = name
self.ZIP = zip_code