Skip to content

Commit

Permalink
Add filter check for validated opslearning
Browse files Browse the repository at this point in the history
  • Loading branch information
susilnem committed Dec 17, 2024
1 parent ef38a4f commit 3c9dda6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions per/drf_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,15 @@ def stats(self, request):
)

learning_by_sector = (
SectorTag.objects.filter(title__isnull=False)
SectorTag.objects.filter(validated_sectors__in=queryset, title__isnull=False)
.annotate(count=Count("validated_sectors", distinct=True))
.values("title", "count")
)

sources_overtime = {
Appeal.objects.filter(opslearning__in=queryset)
.annotate(type=F("atype"), year=F("start_date"), count=Count("opslearning", distinct=True))
.values("type", "year", "count")
.annotate(type=F("atype"), date=F("start_date"), count=Count("opslearning", distinct=True))
.values("type", "date", "count")
}

learning_by_region = (
Expand Down
1 change: 1 addition & 0 deletions per/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ class LearningBySectorSerializer(serializers.Serializer):


class LearningSourcesOvertimeSerializer(serializers.Serializer):
type = serializers.IntegerField()
date = serializers.DateField()
count = serializers.IntegerField()

Expand Down

0 comments on commit 3c9dda6

Please sign in to comment.