You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have Model and View aka Node, but we lack a way to write code between them.
classPetBusinessLogic:
def__init__(self, pet):
self.pet=pet@propertydefname1(self):
returnself.pet.name+"!"@propertydefname2(self):
returnself.pet.name+"!"classPet(SQLAlchemyObjectType):
classMeta:
model=PetModelname="Pet"interfaces= (relay.Node,)
batching=Truedefresolve_name1(node, info):
# write here application logic code for a large project is not good idea.# so we need some controller aka PetBusinessLogicreturnPetBusinessLogic(node).name1# DRY and I would like to initialize it oncedefresolve_name2(node, info):
returnPetBusinessLogic(node).name2# DRY and I would like to initialize it once
Any suggestions for this design problem?
*(put this PetBusinessLogic into model is also bad idea)
The text was updated successfully, but these errors were encountered:
We have Model and View aka Node, but we lack a way to write code between them.
Any suggestions for this design problem?
*(put this PetBusinessLogic into model is also bad idea)
The text was updated successfully, but these errors were encountered: