'add the given reified group fields into `values`'

def _add_reified_groups(self, fields, values):

    gids = set(parse_m2m((values.get('groups_id') or [])))
    for f in fields:
        if is_boolean_group(f):
            values[f] = (get_boolean_group(f) in gids)
        elif is_selection_groups(f):
            selected = [gid for gid in get_selection_groups(f) if (gid in gids)]
            values[f] = ((selected and selected[(-1)]) or False)
