add db session

This commit is contained in:
vincent 2021-06-21 22:32:43 +02:00
parent 718d573f8a
commit d0a0627468

View File

@ -1,8 +1,10 @@
from pony.orm import db_session
from ITPlanning import db
class filldatabase:
@staticmethod
@db_session
def create_Customer():
return db.Customer(
first_name="john",
@ -14,6 +16,7 @@ class filldatabase:
)
@staticmethod
@db_session
def create_service_category():
return db.Service_category(
name="install",
@ -23,6 +26,7 @@ class filldatabase:
)
@staticmethod
@db_session
def create_service():
service_category = filldatabase.create_service_category()
return db.Service(
@ -30,6 +34,7 @@ class filldatabase:
)
@staticmethod
@db_session
def create_planning():
return db.Planning(
name="refresh1",
@ -37,9 +42,11 @@ class filldatabase:
)
@staticmethod
@db_session
def create_ticket():
pass
@staticmethod
@db_session
def create_Planner():
pass