add db session
This commit is contained in:
parent
718d573f8a
commit
d0a0627468
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user