MCPcopy Index your code
hub / github.com/faif/python-patterns / register

Method register

patterns/structural/mvc.py:140–149  ·  view source on GitHub ↗
(
        self,
        path: str,
        controller_class: type[Controller],
        model_class: type[Model],
        view_class: type[View],
    )

Source from the content-addressed store, hash-verified

138 self.routes = {}
139
140 def register(
141 self,
142 path: str,
143 controller_class: type[Controller],
144 model_class: type[Model],
145 view_class: type[View],
146 ) -> None:
147 model_instance: Model = model_class()
148 view_instance: View = view_class()
149 self.routes[path] = controller_class(model_instance, view_instance)
150
151 def resolve(self, path: str) -> Controller:
152 if self.routes.get(path):

Callers 2

mvc.pyFile · 0.80

Calls

no outgoing calls

Tested by 1