@classmethod
def build_sub_where_criteria(cls, sub_where_criteria, sub_condition):
    """
        Build sub where criteria form sub_condition ((sub_condition1), operator, (sub_condition2))
        eg. (('active', '=', True), 'OR', ('name', '=', 'sanish'))
        :type sub_where_criteria: dict
        :param sub_where_criteria: sub where criteria {'and_conditions':list, 'or_conditions':list}
        :type sub_condition: tuple
        :param sub_condition: sub condition (('active', '=', True), 'OR', ('name', '=', 'sanish'))
        """
    if isinstance(sub_condition, tuple) is False or len(sub_condition) != 3:
        raise TypeError('Invalid criteria condition: {}'.format(sub_condition))
    if 'and_conditions' not in sub_where_criteria or isinstance(
        sub_where_criteria.get('and_conditions'), list
        ) is False or 'or_conditions' not in sub_where_criteria or isinstance(
        sub_where_criteria.get('or_conditions'), list) is False:
        raise TypeError('Invalid where criteria data initialized: {}'.
            format(sub_where_criteria))
    condition1 = sub_condition[0]
    condition2 = sub_condition[2]
    operator = sub_condition[1]
    if isinstance(condition1, tuple) is False:
        raise TypeError('Invalid criteria condition: {}'.format(condition1))
    if isinstance(condition2, tuple) is False:
        raise TypeError('Invalid criteria condition: {}'.format(condition2))
    if isinstance(operator, str) is False or operator not in ['AND', 'OR']:
        raise TypeError('criteria {} operator: should be [AND | OR]'.format
            (sub_condition))
    cls.build_where_criteria(sub_where_criteria, condition1, operator.upper())
    cls.build_where_criteria(sub_where_criteria, condition2, operator.upper())
