def get_info_serial(serial): """ Returns Image """ s = db.session() return s.query(Image).filter( Image.EXIF_BodySerialNumber.isnot(None)).filter( Image.EXIF_BodySerialNumber == serial).all()
def filter_all(columns): """ Returns a filters list of tuples """ if isinstance(columns, str): columns = [columns] cols = [getattr(Image, col) for col in columns] s = db.session() return s.query(*cols).all()
def reset_db(): s = db.session() imgs_to_delete = s.query(Image).filter(Image.Uploaded == 1).all() for image in imgs_to_delete: s.delete(image) s.commit()
def get_info(name): """ Returns Image """ s = db.session() return s.query(Image).filter(Image.img_file == name).all()
def get_all_images(): """ Returns a list of all images (data is stored in an Image object) """ s = db.session() return s.query(Image).all()
def reset_db(): s = db.session() imgs_to_delete = s.query(Image).filter(Image.Uploaded ==1).all() for image in imgs_to_delete: s.delete(image) s.commit()
def get_info_serial(serial): """ Returns Image """ s = db.session() return s.query(Image).filter(Image.EXIF_BodySerialNumber.isnot(None)).filter(Image.EXIF_BodySerialNumber == serial).all()