get queryset

def get_queryset_by_group_and_key(self, group, key=None):
        """get queryset"""
        if key is None:
            return self.filter_by(group=group)

        else:
            return self.filter_by(group=group, key=key)