Opened 3 years ago

Closed 3 years ago

#19983 closed Cleanup/optimization (needsinfo)

Improving this part from confusion

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


At the point where we are asked to add the unicode method, the tutorial seems to be taking a shortcut by saying :

Wait a minute. <Poll: Poll object> is, utterly, an unhelpful representation of this object. Let’s fix that by editing the polls model (in the polls/ file) and adding a unicode() method to both Poll and Choice:

class Poll(models.Model):

# ...
def unicode(self):

return self.question

class Choice(models.Model):

# ...
def unicode(self):

return self.choice_text


This was very confusing to me, and though i managed to put bits of code together and make this work, I have no idea whether or not i did it right.

Could you perhaps improve this part of the tutorial by being more comprehensive ?

Change History (2)

comment:1 Changed 3 years ago by timo

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

Thanks for the feedback. Could you please be a bit more specific about what you found confusing and offer a suggestion for how to improve it?

comment:2 Changed 3 years ago by timo

  • Resolution set to needsinfo
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top