-
Notifications
You must be signed in to change notification settings - Fork 70
refactor: update KlassDetailView by converting ancestors to set #245
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
base: main
Are you sure you want to change the base?
Conversation
@allrob23 – Thanks for taking the time to contribute! While this PR is very small and looks like it should be fine, I'm not keen to accept it for a few reasons:
The last one deserves a bit more of an explanation. CCBV runs as a Django site, pulling data from a database. This made it very fast to get up and running and maintain for a bunch of Django-using developers, but it has been a thorn in our side for years. The dataset is entirely fixed. Any changes to the GCBVs only happen in a release of Django. We do not need to dynamically construct templates from the data on every request. We can write out some HTML and never touch it again (unless we feel like changing the site's styles, I guess!) The code is also tightly coupled to Django's GCBVs. There have been sites for other Django-specific class hierarchies using forks of CCBVs for years. @meshy and I have been talking, and more recently, @meshy has been doing the hard work of actually implementing the extraction of a core set of functionalities that would make it possible to generate static datasets of class hierarchies. So, where can we go next? To progress this PR I'd like to see some meaningful performance improvements. A difference measured in nano-seconds isn't going to be of much interest to us, I'm afraid (and I hope you can understand why :)). Alternatively, there are several low-hanging fruit tickets that you could look at instead. |
This modernises the project's README to match the current state of the project (ie dropping tools we should look at), tidies up the prose to be more succinct, and splits out contribution docs to CONTRIBUTING.md. The contributor docs have been streamlined to point to the `make` commands where possible. I've also added a section from #245 on where the project is going. It's a long piece of work so my hope is this sets expectations without making the maintainers feel bad when folks raise a PR for defunct or soon-to-be-removed code paths.
This modernises the project's README to match the current state of the project (ie dropping tools we should look at), tidies up the prose to be more succinct, and splits out contribution docs to CONTRIBUTING.md. The contributor docs have been streamlined to point to the `make` commands where possible. I've also added a section from #245 on where the project is going. It's a long piece of work so my hope is this sets expectations without making the maintainers feel bad when folks raise a PR for defunct or soon-to-be-removed code paths.
This modernises the project's README to match the current state of the project (ie dropping tools we should look at), tidies up the prose to be more succinct, and splits out contribution docs to CONTRIBUTING.md. The contributor docs have been streamlined to point to the `make` commands where possible. I've also added a section from #245 on where the project is going. It's a long piece of work so my hope is this sets expectations without making the maintainers feel bad when folks raise a PR for defunct or soon-to-be-removed code paths.
This modernises the project's README to match the current state of the project (ie dropping tools we should look at), tidies up the prose to be more succinct, and splits out contribution docs to CONTRIBUTING.md. The contributor docs have been streamlined to point to the `make` commands where possible. I've also added a section from #245 on where the project is going. It's a long piece of work so my hope is this sets expectations without making the maintainers feel bad when folks raise a PR for defunct or soon-to-be-removed code paths.
This PR enhances the
KlassDetailView
incbv/views.py
by making a small but effective change. The original code convertedklass.get_ancestors()
to a list:I made this because in the next command we have a
ancestor in direct_ancestors
Why This Change?
Though the performance gain might not be dramatic for small datasets, this change is a proactive step toward scalability and cleaner code