Esempio n. 1
0
def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)):
    # receive json movie without id and return json movie from database with new id
    return crud.create_star(db=db, star=star)
Esempio n. 2
0
def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)):
    return crud.create_star(db=db, star=star)
Esempio n. 3
0
def make_movie(star: schemas.MovieCreate, db: Session = Depends(get_db)):
    return crud.create_star(db=db, star=star)
Esempio n. 4
0
def create_star(star: schemas.StarCreate, db: Session = Depends(get_db)):
    db_star = crud.get_stars_by_name(db, name=star.name)
    if db_star:
        raise HTTPException(status_code=400,
                            detail="Star %s already in db." % name)
    return crud.create_star(db=db, star=star)