set|create/update

def set_value(self, general_object_model_class, group, key=None, value=None):
        """set|create/update"""
        if key is None:
            key = group

        obj = self.get_queryset_by_group_and_key(group=group, key=key).first()
        if obj is None:
            obj = general_object_model_class(
                group=group,
                key=key,
                value=value
            )

        else:
            obj.value = value

        self.session.add(obj)
        self.session.commit()
        return obj