def exists(self, model_class, ID):
        '''Check if a record of id==ID exists in table model_class.__name__.lower()'''

        assert hasattr(model_class, '_fields'), 'Not a valid model class'
        res = self.get(model_class, id=ID, fetchOne=True)
        if res:
            return True
        return False
def exists ( self , model_class , ID ) : assert hasattr ( model_class , '_fields' ) , 'Not a valid model class' res = self . get ( model_class , id = ID , fetchOne = True ) if res : return True return False
Check if a record of id==ID exists in table model_class.__name__.lower()