[Django] #25358: Improve variable name for question in tutorial

2 views
Skip to first unread message

Django

unread,
Sep 6, 2015, 7:33:25 AM9/6/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
--------------------------------------+--------------------
Reporter: alasdairnicol | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
In the docs, Tutorial 4 uses the variable `p` for question. I think this
is historical, because the model used to be named `Poll` before #20876.

{{{
p = get_object_or_404(Question, pk=question_id)
}}}

I think that `q` would be an improvement, but `question` would be better.

If we make this change, ideally we would backport to the 1.7.X and 1.8.X
docs, because I've seen users get confused when they mistakenly switch
between different versions in the tutorial. My patch causes a minor
conflict when applied to 1.7.X and 1.8.X, but wouldn't be too hard to fix.

--
Ticket URL: <https://code.djangoproject.com/ticket/25358>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 6, 2015, 7:36:29 AM9/6/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by alasdairnicol):

* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0


Comment:

Pull request https://github.com/django/django/pull/5238/

--
Ticket URL: <https://code.djangoproject.com/ticket/25358#comment:1>

Django

unread,
Sep 6, 2015, 7:39:55 AM9/6/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Since we don't have a workflow for updating 1.7 translations, we avoid
backporting changes in translatable text to 1.7.

--
Ticket URL: <https://code.djangoproject.com/ticket/25358#comment:2>

Django

unread,
Sep 6, 2015, 7:51:11 AM9/6/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
-------------------------------------+-------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by alasdairnicol):

Replying to [comment:2 aaugustin]:


> Since we don't have a workflow for updating 1.7 translations, we avoid
backporting changes in translatable text to 1.7.

Thanks, I wasn't aware of that. On second thoughts, having a different
version in 1.7 and 1.8+ wouldn't be too big a problem, since the changes
are self contained within each view (you don't even need to update the
related template, since the old and new versions both use `question` in
the template context. On the other hand, I'd understand if you think this
is too minor a change and won't fix it.

--
Ticket URL: <https://code.djangoproject.com/ticket/25358#comment:3>

Django

unread,
Sep 6, 2015, 7:55:23 AM9/6/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
--------------------------------------+------------------------------------

Reporter: alasdairnicol | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* stage: Unreviewed => Accepted


Comment:

I think it's a worthwhile improvement.

--
Ticket URL: <https://code.djangoproject.com/ticket/25358#comment:4>

Django

unread,
Sep 7, 2015, 8:14:09 AM9/7/15
to django-...@googlegroups.com
#25358: Improve variable name for question in tutorial
--------------------------------------+------------------------------------
Reporter: alasdairnicol | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"19f98946f2b31b62303aedb5b30951ca295116d8" 19f98946]:
{{{
#!CommitTicketReference repository=""
revision="19f98946f2b31b62303aedb5b30951ca295116d8"
Fixed #25358 -- Improved variable name for question in tutorial.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25358#comment:5>

Reply all
Reply to author
Forward
0 new messages