From 812ec4aa31b9913c1d1a8a6bf69c6e1960ad90b6 Mon Sep 17 00:00:00 2001 From: kongxy Date: Thu, 1 Aug 2024 18:55:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4equipment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crud.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crud.py b/crud.py index 3b3ab93..bb435a0 100644 --- a/crud.py +++ b/crud.py @@ -3,20 +3,20 @@ from sqlalchemy.orm import Session import models, schemas -def get_equipment(db: Session, equipment_id: int): - return db.query(models.Equipment).filter(models.Equipment.id == equipment_id).first() - - -def get_equipments(db: Session, skip: int = 0, limit: int = 10): - return db.query(models.Equipment).offset(skip).limit(limit).all() - - -def create_equipment(db: Session, equipment: schemas.EquipmentCreate): - db_equipment = models.Equipment(**equipment.dict()) - db.add(db_equipment) - db.commit() - db.refresh(db_equipment) - return db_equipment +# def get_equipment(db: Session, equipment_id: int): +# return db.query(models.Equipment).filter(models.Equipment.id == equipment_id).first() +# +# +# def get_equipments(db: Session, skip: int = 0, limit: int = 10): +# return db.query(models.Equipment).offset(skip).limit(limit).all() +# +# +# def create_equipment(db: Session, equipment: schemas.EquipmentCreate): +# db_equipment = models.Equipment(**equipment.dict()) +# db.add(db_equipment) +# db.commit() +# db.refresh(db_equipment) +# return db_equipment def get_device(db: Session, device_id: int):