Skip to content

Remove database queries from nav template#174

Merged
meshy merged 12 commits intomainfrom
remove-db-from-nav
Jun 12, 2022
Merged

Remove database queries from nav template#174
meshy merged 12 commits intomainfrom
remove-db-from-nav

Conversation

@meshy
Copy link
Copy Markdown
Contributor

@meshy meshy commented Jun 12, 2022

We shouldn't be making queries in templates, but unfortunately, that happens a lot in this project.

This removes the database queries from the nav template, and moves them into the nav templatetag code. I'm not in love with the code that's come out of this, but it's a step in the right direction.

As a bonus, we've shaved a few queries out of what is required when rendering the page.

I've shamelessly added my new library django-sans-db, and have set it up to prevent regressions in this template.

@meshy meshy merged commit b4a20da into main Jun 12, 2022
@meshy meshy deleted the remove-db-from-nav branch June 12, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant