'Add an item to a subgroup. Create that subgroup if it does not
yet exist.
@param key: the grouping key
@param value: the grouping value for the subgroup
@param item: the item to add to the subgroup'

def add_to_group(self, key, value, item):

    groups = self._groups_dict
    if (value in groups):
        group = groups[value]
        group.add(item)
    else:
        values = dict(self.values)
        values[key] = value
        group = S3GroupedItems([item], groupby=self.groupby, values=values)
        groups[value] = group
        self._groups_list.append(value)
    return group
