Filter Events by active ones (starts after now)#668
Conversation
|
|
||
| def get_queryset(self): | ||
| qs = Event.objects.all() | ||
| qs = Event.objects.filter(start_time__gte=timezone.now()) |
There was a problem hiding this comment.
idk if past events are ever used but the page takes forever to load rn
There was a problem hiding this comment.
Currently past events aren't accessible via the frontend...however with ticketing this will change, so I don't think this should be default behavior. Instead we could add this as a query parameter + an index on start time? @aviupadhyayula feel free to chime in
There was a problem hiding this comment.
Makes sense to me. I'm not a huge fan of filtering out past events by default.
Also, this is probably an issue with our serializer, and not the query.
There was a problem hiding this comment.
@rm03's suggestion sounds pretty good. For context, Jacky is trying to use this route to render events on iOS but the page is just too massive to load since it contains all events ever
There was a problem hiding this comment.
Maybe we have some unnoticed N+1s here?
There was a problem hiding this comment.
Maybe we have some unnoticed N+1s here?
Doesn't look like it, just checked locally
No description provided.