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