Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10266 closed (fixed)

Tutorial 01 __unicode__ step needs reload

Reported by: g4d Owned by: kkubasik
Component: Documentation Version: 1.0
Severity: Keywords: Tutorial 01, Tutorial01, unicode, __unicode__, model, models kkmegapatch
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hi,

In going through Tutorial 01, there seems to be a small step missing after adding the unicode methods to polls.models.py.

After adding unicode methods to models.py and entering "Poll.objects.all()" in the shell, I got the same response as before adding unicode methods ( [<Poll: Poll object>] ). I figured that my new changes had to be reloaded. Not knowing any spiffy command for reloading, I closed and reopened the shell and imported my project again. When I then entered Poll.object.all() in the shell, I got the expected [<Poll: What's up?>].

In retrospect, I probably could have just re-entered the import. I'm brand new to Django and pretty new to Python as well, so I will not try to supply the proper solution.

Hope this helps!

Regards,

G4D

Attachments (1)

10266.diff (541 bytes) - added by mboersma 6 years ago.
Clarify that the user must start a new Python shell to see changes to models

Download all attachments as: .zip

Change History (9)

comment:1 Changed 6 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

#10269 is similar and was closed as a dupe. Note if you read far enough, the text mentions "jumping back into" the shell, implying a restart. But it seems that people are trying to test this change out immediately, so perhaps earlier mention (if it doesn't already exist, I haven't checked) of the need to restart the shell in order for any change such as this to take effect would be good. I thought it was already there somewhere but I may be remembering that from a beginning Python tutorial, not Django tutorial.

comment:2 Changed 6 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

Changed 6 years ago by mboersma

Clarify that the user must start a new Python shell to see changes to models

comment:3 Changed 6 years ago by mboersma

  • Has patch set

Rather than explain any mechanics of Python's class loader to tutorial readers, I simply removed the "jump back into the shell" wording and replaced it with "start a new shell," which shouldn't be error-prone if people are following along.

comment:4 Changed 6 years ago by timo

  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 6 years ago by kkubasik

  • Keywords kkmegapatch added
  • Owner changed from nobody to kkubasik

comment:6 Changed 6 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

(In [10263]) Fixed #10266 -- Clarified restart of shell in tutorial, patch from mboersma.

comment:7 Changed 6 years ago by gwilson

(In [10264]) [1.0.X]: Fixed #10266 -- Clarified restart of shell in tutorial, patch from mboersma.

Backport of r10263 from trunk.

comment:8 Changed 4 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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