-
Notifications
You must be signed in to change notification settings - Fork 68
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
Reduce reliance on get_absolute_url
#244
base: main
Are you sure you want to change the base?
Commits on Jun 13, 2024
-
Remove redundant version fetch
The block above this line fetches the latest matching version, so it's pointless to then use that to get the latest version's URL. Instead, we get the URL of the object we already have.
Configuration menu - View commit details
-
Copy full SHA for 0ac2530 - Browse repository at this point
Copy the full SHA 0ac2530View commit details -
Customise QuerySet instead of Manager
This will allow us to add custom queryset methods in an upcoming commit.
Configuration menu - View commit details
-
Copy full SHA for f8973fa - Browse repository at this point
Copy the full SHA f8973faView commit details -
Remove direct knowledge of Django URLs from models
Django models shouldn't know anything about URLs. This is a step in the direction of removing `get_absolute_url` from the models.
Configuration menu - View commit details
-
Copy full SHA for dad158d - Browse repository at this point
Copy the full SHA dad158dView commit details -
Configuration menu - View commit details
-
Copy full SHA for de10f03 - Browse repository at this point
Copy the full SHA de10f03View commit details -
Separate getting latest version from URL
Before this change, we used a model helper method to fetch the URL of the latest version of a matching class. Now we fetch the latest version, and then get its URL.
Configuration menu - View commit details
-
Copy full SHA for 26e1cd0 - Browse repository at this point
Copy the full SHA 26e1cd0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f65b2c9 - Browse repository at this point
Copy the full SHA f65b2c9View commit details -
Replace some calls to Klass().get_absolute_url()
Part of the process of removing the models is ensuring that we don't rely on any methods that live on them. This change removes most references to `get_absolute_url` on `Klass`, leaving behind those in the templates.
Configuration menu - View commit details
-
Copy full SHA for 1271520 - Browse repository at this point
Copy the full SHA 1271520View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d15e45 - Browse repository at this point
Copy the full SHA 2d15e45View commit details -
Move get_prepared_attributes from model to view
We're in the process of moving logic off the models. This model method was only used by one view. This moves the logic from the model to the view.
Configuration menu - View commit details
-
Copy full SHA for 46c1fcf - Browse repository at this point
Copy the full SHA 46c1fcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 27fbac2 - Browse repository at this point
Copy the full SHA 27fbac2View commit details -
Use a defaultdict for building mapped list
We were previously manually doing what defaultdict does for us.
Configuration menu - View commit details
-
Copy full SHA for 464fcd0 - Browse repository at this point
Copy the full SHA 464fcd0View commit details
Commits on Jun 16, 2024
-
Add test for view with overridden attributes
Before this change, we didn't have a test which covered rendering overridden attributes. This change adds UpdateView to the snapshot tests, to catch regressions.
Configuration menu - View commit details
-
Copy full SHA for 99df59c - Browse repository at this point
Copy the full SHA 99df59cView commit details -
Test get_all_ancestors against UpdateView
We previously tested against a couple of simple artificial examples, but I didn't trust it to cover all the possible cases. This change ensures that we're testing against a complicated real-world example, UpdateView, which I believe to represent sufficient complexity.
Configuration menu - View commit details
-
Copy full SHA for e9f1b79 - Browse repository at this point
Copy the full SHA e9f1b79View commit details