[Django] #35737: Missing import statement in tutorial

4 views
Skip to first unread message

Django

unread,
Sep 5, 2024, 2:26:41 PM9/5/24
to django-...@googlegroups.com
#35737: Missing import statement in tutorial
--------------------------+-----------------------------------------
Reporter: Mariatta | Type: Bug
Status: new | Component: Documentation
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------+-----------------------------------------
On this tutorial:
https://docs.djangoproject.com/en/5.1/intro/tutorial07/#id8


It is missing the import for `models` which is used to define the
`Question` model.

{{{#!python
from django.db import models
}}}

Not adding the import statement could be confusing to the new learners,
because throughout the tutorials, it uses `models` from both
django.db.models and `polls.models`. On the previous examples of this
tutorial page, it uses `models` imported from the `polls` app, so it would
be useful to remind new learners that we're extending the `models.Model`
from `django.db` and not the one from the `polls.models`.

The same issue seems to appear in v 4 as well. I didn't check the earlier
versions.
If you'd agree this is worth fixing, I can open a PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/35737>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages