Added first version of database and orm
This commit is contained in:
14
src/tests_dev/db/city.py
Normal file
14
src/tests_dev/db/city.py
Normal 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
|
||||
Reference in New Issue
Block a user