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
from .dependency_configimportcontainer@container.bind_viewdefindex(request, dep: SomeService):
returnHttpResponse(f"service says: {dep.get_message()}")
# Or if you prefer class based views@container.bind_viewclassCBVexample(View):
defget(self, request, dep: SomeService):
returnHttpResponse(f"service says: {dep.get_message()}")
vs. explicit:
fromlagomimportinjectablefrom .dependency_configimportcontainer@container.bind_viewdefindex(request, dep: SomeService=injectable):
returnHttpResponse(f"service says: {dep.get_message()}")
# Or if you prefer class based views@container.bind_viewclassCBVexample(View):
defget(self, request, dep: SomeService=injectable):
returnHttpResponse(f"service says: {dep.get_message()}")
The text was updated successfully, but these errors were encountered:
Magic (the current implementation):
vs. explicit:
The text was updated successfully, but these errors were encountered: