(self, record_name, record, severity, *fields)
return missing
Checks if all required fields are present in record
            Used to validate incoming data
            Returns list of field names that are missing or empty
Checks if all required fields are present in record
            Used to validate incoming data
            Returns list of field names that are missing or empty
Checks if all required fields are present in record Used to validate incoming data Returns list of field names that are missing or empty
def check_required(self, record_name, record, severity, *fields):
        """ Checks if all required fields are present in record
            Used to validate incoming data
            Returns list of field names that are missing or empty
        """
        missing = []
        params = {self.PARAM: record_name}
        if self.ROW in record:
            params[self.ROW] = record[self.ROW]
        for field in fields:
            params[self.FIELD] = field
            if field in record:
                if record[field] is None or (isinstance(record[field], basestring) and len(record[field]) == 0):
                    self.tell_user(severity, "dbsXXXX", "Required value missing: {%s}.{%s}" % (self.PARAM, self.FIELD), **params)
                    missing.append(field)
            else:
                self.tell_user(severity, "dbsXXXX", "Required field missing: {%s}.{%s}" % (self.PARAM, self.FIELD), **params)
                missing.append(field)
        return missing
def check_required ( self , record_name , record , severity , * fields ) : missing = [ ] params = { self . PARAM : record_name } if self . ROW in record : params [ self . ROW ] = record [ self . ROW ] for field in fields : params [ self . FIELD ] = field if field in record : if record [ field ] is None or ( isinstance ( record [ field ] , basestring ) and len ( record [ field ] ) == 0 ) : self . tell_user ( severity , "dbsXXXX" , "Required value missing: {%s}.{%s}" % ( self . PARAM , self . FIELD ) , * * params ) missing . append ( field ) else : self . tell_user ( severity , "dbsXXXX" , "Required field missing: {%s}.{%s}" % ( self . PARAM , self . FIELD ) , * * params ) missing . append ( field ) return missing