Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong class instance #72

Closed
SarloAkrobata opened this issue Jan 6, 2023 · 2 comments
Closed

Wrong class instance #72

SarloAkrobata opened this issue Jan 6, 2023 · 2 comments

Comments

@SarloAkrobata
Copy link
Contributor

SarloAkrobata commented Jan 6, 2023

crud_user = CRUDBase(User)

It should be like this:
crud_user = CRUDUser(User)

Also I think better way would be like this, because it makes open for extendibility (eg. write or overwrite specific queries, the features of repository pattern):

from app.models.users import User
from app.schemas.user import UserInDB, UserUpdateDB

class CRUDUser(CRUDBase[User, UserInDB, UserUpdateDB]):
    pass

crud_user = CRUDUser(User)
@Kludex
Copy link
Owner

Kludex commented Jan 6, 2023

Thanks. PR welcome.

@Kludex
Copy link
Owner

Kludex commented Jun 19, 2023

This was solved already. 👍

@Kludex Kludex closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants