Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
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()
Пример #4
0
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()
Пример #5
0
def get_info(name):
    """
    Returns Image
    """
    s = db.session()
    return s.query(Image).filter(Image.img_file == name).all()
Пример #6
0
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()
Пример #7
0
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()
Пример #8
0
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()
Пример #9
0
def get_info(name):
    """
    Returns Image
    """
    s = db.session()
    return s.query(Image).filter(Image.img_file == name).all()
Пример #10
0
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()