Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

events page refactor #315

Open
derekeder opened this issue Dec 24, 2022 · 0 comments
Open

events page refactor #315

derekeder opened this issue Dec 24, 2022 · 0 comments

Comments

@derekeder
Copy link
Member

From #314 (review) by @fgregg there are a number of improvements we can make to the events listing page now that we have all the view code brought in:

        context = super(EventsView, self).get_context_data(**kwargs)

        # Get year range for datepicker.
        aggregates = ChicagoEvent.objects.aggregate(

this could be improved a good bit by not using the parameter, but instead defining two url rules

the current:

url(r"^events/$", views.EventsView.as_view(), name="events")

which would dispatch to the default upcoming events and

url(r"^events/(?P<date>\d{4}-{2}-{2})/$", views.MonthEventsView.as_view(), name="events"),

which dispatched to new view for just that selected month.

            org_select_events = []

            for event_date, events in itertools.groupby(select_events, key=day_grouper):

it would be very nice to push this grouping logic into the templates with the regroup tag.

https://openfolder.sh/grouping-in-django-templates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant