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
In the project I developed with Fastapi, I want to use di as decoupled example at the package level.
I have OwnerContainer in owner package and i have ApplicationContainer in top level main package.
`
class OwnerContainer(containers.DeclarativeContainer):
I got error 'Provide' object has no attribute 'get_owners'
According to my research, this is related to the dependency injector not being able to wire. I can't figure out whether this is related to a bug or whether I made a mistake, but I think I used it in accordance with the examples.
Has anyone encountered this type of problem? I need some help.
The text was updated successfully, but these errors were encountered:
version: 4.41.0
fastapi version: 0.110.2
In the project I developed with Fastapi, I want to use di as decoupled example at the package level.
I have OwnerContainer in owner package and i have ApplicationContainer in top level main package.
`
class OwnerContainer(containers.DeclarativeContainer):
config = providers.Configuration()
database_session = providers.Resource(
get_db_session
)
I want to use OwnerService in my owner router
@owner_router.get("/", response_model=List[GetOwnerSchema]) @inject async def get_owners(service: OwnerService = Depends(Provide[OwnerContainer.owner_service])): try: result: List[GetOwnerSchema] = await service.get_owners() return result except Exception as e: print(e) raise HTTPException(status_code=500)
I got error 'Provide' object has no attribute 'get_owners'
According to my research, this is related to the dependency injector not being able to wire. I can't figure out whether this is related to a bug or whether I made a mistake, but I think I used it in accordance with the examples.
Has anyone encountered this type of problem? I need some help.
The text was updated successfully, but these errors were encountered: