Added dao base
All checks were successful
All checks were successful
This commit is contained in:
14
tests/custom/database/src/model/user_dao.py
Normal file
14
tests/custom/database/src/model/user_dao.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from cpl.database import InternalTables
|
||||
from cpl.database.abc import DbModelDaoABC
|
||||
from model.user import User
|
||||
|
||||
|
||||
class UserDao(DbModelDaoABC[User]):
|
||||
|
||||
def __init__(self):
|
||||
DbModelDaoABC.__init__(self, __name__, User, InternalTables.users)
|
||||
|
||||
self.attribute(User.name, str)
|
||||
self.attribute(User.city_id, int, db_name="CityId")
|
||||
|
||||
self.reference("city", "id", User.city_id, "city")
|
||||
Reference in New Issue
Block a user