How to use the eventy.models.EventTime.objects.filter function in eventy

To help you get started, we’ve selected a few eventy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github powellc / django-eventy / eventy / models.py View on Github external
def get_next_event_time(self):
        """Determines the next event time"""

        if not self._next:
            try:
                qs = EventTime.objects.filter(event=self.event).exclude(id__exact=self.id)
                event_time= qs.filter(start__gte=self.start).order_by('start')[0]
            except (EventTime.DoesNotExist, IndexError):
                event_time = None
            self._next = event_time

        return self._next