Opened 9 years ago

Closed 9 years ago

#12623 closed (invalid)

apostrophes in the python interactive shell documentation

Reported by: zakir2k Owned by: nobody
Component: Documentation Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



I am a total beginner to Django and web development in general, so whilst using the very well written tutorial 'Writing your first Django app, part 1' -> I came stuck at the second part of using the interactive shell to explore the database ID. Within the Python Shell, the documentation says to:

# Give the Poll a couple of Choices. The create call constructs a new
# choice object, does the INSERT statement, adds the choice to the set
# of available choices and returns the new Choice object.

p = Poll.objects.get(pk=1)
p.choice_set.create(choice='Not much', votes=0)

<Choice: Not much>

p.choice_set.create(choice='The sky', votes=0)

<Choice: The sky>

c = p.choice_set.create(choice='Just hacking again', votes=0)

However I became stuck for quite some time, because instead of having Not Much, The Sky etc. in quotation marks ("Not Much" etc.) as was done earlier in the documentation for creating the question "What's Up?" in the shell, The documentation changes it to apostrophes ('Not Much' etc.).

This didn't work in the shell, and as a complete Novice, following the doc letter for letter, I was confused for quite some time.




Change History (1)

comment:1 Changed 9 years ago by Luke Plant

Resolution: invalid
Status: newclosed

If single quotes don't work for you, that's very strange, and must be a bug in your Python shell. Sorry for your confusion, but the documentation is correct. It's difficult to imagine a Python shell where single quotes don't work, so perhaps something else is going on.

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