Skip to content

Commit 2401054

Browse files
committed
Update the docs links to the latest versions of Django.
1 parent ef35bc4 commit 2401054

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/lab1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Let's consider what we know:
118118

119119
- Does the file show up on the server side?
120120
- Using the IDE's debugger, a ``breakpoint()`` line or a print statement, inspect
121-
[``request.FILES``](https://docs.djangoproject.com/en/4.1/ref/request-response/#django.http.HttpRequest.FILES).
121+
[``request.FILES``](https://docs.djangoproject.com/en/stable/ref/request-response/#django.http.HttpRequest.FILES).
122122
- Are there any files included? Is ``"open_graph_image"`` a key?
123123
- Is the file being sent from the browser to the server?
124124
- We can use the browser's Developer Tool's Network panel to inspect the request.

docs/lab2.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ is a never ending, relentless battle.
6262

6363
#### Post listing admin
6464
The admin page suffers from a [N+1 problem](https://ddg.gg?q=N%2B1+django) and
65-
needs to make use of [``prefetch_related``](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#django.db.models.query.QuerySet.prefetch_related)
65+
needs to make use of [``prefetch_related``](https://docs.djangoproject.com/en/stable/ref/models/querysets/#django.db.models.query.QuerySet.prefetch_related)
6666
since it renders each category of the post on the page. This can be chained on
6767
the QuerySet by overriding ``ModelAdmin.get_queryset``. The need for
6868
``prefetch_related`` is evident from the 100 duplicated queries that are fetching data from the table
6969
``newsletter_post_categories``. That table is the intermediate table used with
7070
a ``models.ManyToManyField``. There is a slight wrinkle in that the categories
7171
are being rendered in order of the categories' titles. In order to push that
72-
to the database, you must use a [``Prefetch``](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#django.db.models.Prefetch)
72+
to the database, you must use a [``Prefetch``](https://docs.djangoproject.com/en/stable/ref/models/querysets/#django.db.models.Prefetch)
7373
object that specifies:
7474

7575
```python
@@ -164,7 +164,7 @@ squeeze all the speedy goodness out of the application.
164164

165165
That said, consider the application(s) you work on. What are the most
166166
frequently used parts? What do you have in place to catch slowness?
167-
Could you benefit from using [``assertNumQueries(...)``](https://docs.djangoproject.com/en/4.1/topics/testing/tools/#django.test.TransactionTestCase.assertNumQueries)?
167+
Could you benefit from using [``assertNumQueries(...)``](https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.TransactionTestCase.assertNumQueries)?
168168

169169

170170
## Lab 2.2
@@ -302,12 +302,12 @@ Let's consider what we know:
302302
count.
303303
- This can be fixed by using an appropriate ``GROUP BY`` clause in the SQL.
304304
- What does the Django ORM's ``Count`` expression offer in terms of parameters?
305-
- You can use the [docs](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#id9)
306-
or inspect [the code](https://github.com/django/django/blob/stable/4.1.x/django/db/models/aggregates.py#L145-L149)
305+
- You can use the [docs](https://docs.djangoproject.com/en/stable/ref/models/querysets/#id9)
306+
or inspect [the code](https://github.com/django/django/blob/stable/5.2.x/django/db/models/aggregates.py#L159-L163)
307307
(right click on ``Count`` and choose "Go To Definition") in
308308
your IDE if you're using PyCharm or VSCode.
309309
- We can see that ``Count`` subclasses [``Aggregate`` which has ``distinct`` as
310-
a param](https://github.com/django/django/blob/e151df24ae2b0a388fc334a6f1dcb31110d5819a/django/db/models/aggregates.py#L25-L35).
310+
a param](https://github.com/django/django/blob/stable/5.2.x/django/db/models/aggregates.py#L26-L33).
311311

312312
### Conclusion
313313

0 commit comments

Comments
 (0)