Skip to content
Snippets Groups Projects
Verified Commit 42ad6ce2 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add extra query method for announcements for a set of days

parent 073a07d1
No related branches found
No related tags found
1 merge request!184Improve announcement queries
......@@ -312,6 +312,14 @@ class AnnouncementQuerySet(models.QuerySet):
return announcements
def in_days(self, start: date, stop: date) -> models.QuerySet:
""" Get all announcements valid for a set of days """
# Get announcements
announcements = self.filter(valid_from__date__lte=stop, valid_until__date__gte=start)
return announcements
def for_person(self, person: Person) -> List:
""" Get all announcements for one person """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment