From 2dbd908f4c82f1b35cd1744db8c84688e41b74ad Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 1 Jan 2025 19:43:50 +0100 Subject: [PATCH] feat: add method to search active ANs --- src/fellchensammlung/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index b6f0385..74d763e 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -300,6 +300,11 @@ class AdoptionNotice(models.Model): # returns all subscriptions to that adoption notice return Subscriptions.objects.filter(adoption_notice=self) + @staticmethod + def get_active_ANs(): + active_ans = [an for an in AdoptionNotice.objects.all() if an.is_active] + return active_ans + def get_photos(self): """ First trys to get group photos that are attached to the adoption notice if there is none it trys to fetch