models/marking_model.py
def count_failed(cls, month, year):
        """Function which counts how many entries have failed"""
        count = 0
        obj = cls.query.filter(MarkingModel.complete != '').all()
        for o in obj:
            if o.complete.split('-')[1] == month and o.complete.split('-')[0] == year:
                if o.appearance == 'Fail' or o.functions == 'Fail':
                    count += 1
        return count
Function which counts how many entries have failed
Function which counts how many entries have failed
Function which counts how many entries have failed
def count_failed(cls, month, year):
        count = 0
        obj = cls.query.filter(MarkingModel.complete != '').all()
        for o in obj:
            if o.complete.split('-')[1] == month and o.complete.split('-')[0] == year:
                if o.appearance == 'Fail' or o.functions == 'Fail':
                    count += 1
        return count
def count_failed ( cls , month , year ) : count = 0 obj = cls . query . filter ( MarkingModel . complete != '' ) . all ( ) for o in obj : if o . complete . split ( '-' ) [ 1 ] == month and o . complete . split ( '-' ) [ 0 ] == year : if o . appearance == 'Fail' or o . functions == 'Fail' : count += 1 return count
Function which counts how many entries have failed
Function which counts how many entries have failed
"""Function which counts how many entries have failed"""
cls
month
year