Opened 17 years ago

Closed 17 years ago

Last modified 11 years ago

#6317 closed Uncategorized (invalid)

Typo / Error in Tutorial

Reported by: yak-man <yarkot1@…> Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords: Tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

at the end of: [tutorial01]http://www.djangoproject.com/documentation/tutorial01/

...the last interactive Python Shell session:


In [13]: Poll.objects.filter('''question_startswith'''='What')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
 ....

TypeError: Cannot resolve keyword 'question_startswith' into field. Choices are:
 choice, id, question, pub_date


And later in the same debugger session:


In [15]: Poll.objects.get('''pub_date_year'''=2007)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

...
TypeError: Cannot resolve keyword 'pub_date_year' into field. Choices are: choic
e, id, question, pub_date


Eventually, the bottom of the session has a comment about "...Use double underscores to separate relationships..."

Make a copy of that comment early on please ;-/

Change History (5)

comment:1 by James Bennett, 17 years ago

Resolution: invalid
Status: newclosed

Um... the tutorial does have double underscores on those two lookups. Perhaps you misread it?

comment:2 by yak-man <yarkot1@…>, 17 years ago

yes, the tutorial has double-underscores.... and - YES -- it is VERY easy to miss them... (in the first case, all but impossible to see them)

And YES it would be nice to have a hint, so as not to stumble thru it.

I would have preferred some mention of the "double underscore" convention appearing somewhere at the first use (rather than wading thru backtraces, wondering what went wrong).

comment:3 by anonymous, 12 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

Totally agree with this
Do you mean " or because none of this is actually working. Because I miss it too and all the proposal there are invalid

in reply to:  3 comment:4 by anonymous, 12 years ago

Replying to anonymous:

Totally agree with this
Do you mean " or because none of this is actually working. Because I miss it too and all the proposal there are invalid

No ! Double underscore is the explaination ""and not "_"

comment:5 by anonymous, 11 years ago

the question_startswith and pub_date_year are both not working for me. unsure what i am doing wrong

Note: See TracTickets for help on using tickets.
Back to Top