'Leaf validity rules:
- a valid leaf is an operator or a leaf
- a valid leaf has a field objects unless
- it is not a tuple
- it is an inherited field
- left is id, operator is \'child_of\'
- left is in MAGIC_COLUMNS'

def check_leaf(self, internal=False):

    if ((not is_operator(self.leaf)) and (not is_leaf(self.leaf, internal))):
        raise ValueError(('Invalid    leaf    %s' % str(self.leaf)))
