|
|
|
@ -190,6 +190,7 @@ def create_items(
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
# construct a list of schemas.Item items
|
|
|
|
# construct a list of schemas.Item items
|
|
|
|
spreadsheet_item_list = [
|
|
|
|
spreadsheet_item_list = [
|
|
|
|
schemas.ItemCreate(
|
|
|
|
schemas.ItemCreate(
|
|
|
|
@ -201,7 +202,6 @@ def create_items(
|
|
|
|
for row in sheet["data"]
|
|
|
|
for row in sheet["data"]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
# dump all the data into database
|
|
|
|
# dump all the data into database
|
|
|
|
try:
|
|
|
|
|
|
|
|
accepted, processed = crud.insert_items(db=db, items=spreadsheet_item_list)
|
|
|
|
accepted, processed = crud.insert_items(db=db, items=spreadsheet_item_list)
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
raise HTTPException(
|
|
|
|
raise HTTPException(
|
|
|
|
|