diff --git a/osis_history/contrib/mixins.py b/osis_history/contrib/mixins.py index 0107f37..2c8690d 100644 --- a/osis_history/contrib/mixins.py +++ b/osis_history/contrib/mixins.py @@ -4,6 +4,8 @@ from .serializers import HistoryEntryListSerializer from osis_history.models import HistoryEntry +from django.db.models import Q + __all__ = [ "HistoryEntryListAPIMixin", ] @@ -18,7 +20,8 @@ def get_queryset(self): """Filter the queryset with the object's uuid passed in url""" qs = HistoryEntry.objects.filter(object_uuid=self.kwargs["uuid"]) tags = self.request.query_params.get('tags', '') - if tags: - qs = qs.filter(tags__contained_by=tags.split(',')) - return qs + queries = [Q(tags__contains=[tag]) for tag in tags.split(',')] + for query in queries: + qs |= qs.filter(query) + return qs diff --git a/package.json b/package.json index 883051e..91b48ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "osis-history", - "version": "0.1.0", + "version": "0.4.0", "private": true, "scripts": { "build": "vite build --outDir osis_history/static/osis_history --mode production --sourcemap true", diff --git a/setup.py b/setup.py index ce34c13..825023f 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ setup( name='OSIS History', - version='0.3', + version='0.4', description='History management API and UI', url='http://github.com/uclouvain/osis-history', author='Université catholique de Louvain',