Opened 8 years ago

Closed 8 years ago

Last modified 2 years ago

#6317 closed Uncategorized (invalid)

Typo / Error in Tutorial

Reported by: yak-man <yarkot1@…> Owned by: nobody
Component: Documentation Version: master
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 Changed 8 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 8 years ago by yak-man <yarkot1@…>

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 follow-up: Changed 2 years ago by anonymous

  • Easy pickings unset
  • Severity set to Normal
  • Type set to 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

comment:4 in reply to: ↑ 3 Changed 2 years ago by anonymous

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 Changed 2 years ago by anonymous

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