Add base class to simplify CRUD (#23)

This commit is contained in:
Manu
2020-01-19 22:40:50 +01:00
committed by Sebastián Ramírez
parent 1c975c7f2d
commit ab46165387
33 changed files with 322 additions and 283 deletions

View File

@@ -1,6 +1,6 @@
from app import crud
from app.core import config
from app.models.user import UserCreate
from app.schemas.user import UserCreate
# make sure all SQL Alchemy models are imported before initializing DB
# otherwise, SQL Alchemy might fail to initialize properly relationships
@@ -21,4 +21,4 @@ def init_db(db_session):
password=config.FIRST_SUPERUSER_PASSWORD,
is_superuser=True,
)
user = crud.user.create(db_session, user_in=user_in)
user = crud.user.create(db_session, obj_in=user_in)