'Build an opts object from the UI settings to pass to the catalog builder
Handles two types of rules sets, with and without [\'prefix\'] field
Store processed opts object to opt_dict'

def construct_tw_opts_object(self, c_name, opt_value, opts_dict):

    rule_set = []
    for stored_rule in opt_value:
        rule = stored_rule.copy()
        if (not rule['enabled']):
            continue
        elif ((not rule['field']) or (not rule['pattern'])):
            continue
        elif (('prefix' in rule) and (rule['prefix'] is None)):
            continue
        elif (rule['field'] != _('Tags')):
            rule['field'] = self.eligible_custom_fields[rule['field']]['field']
            if (rule['pattern'] in [_('any    value'), _('any    date')]):
                rule['pattern'] = '.*'
            elif (rule['pattern'] == _('unspecified')):
                rule['pattern'] = 'None'
        if ('prefix' in rule):
            pr = (rule['name'], rule['field'], rule['pattern'], rule['prefix'])
        else:
            pr = (rule['name'], rule['field'], rule['pattern'])
        rule_set.append(pr)
    opt_value = tuple(rule_set)
    opts_dict[c_name[:(-3)]] = opt_value
