noisebridge / pyclass-project

Other
8 stars 2 forks source link

Make status on ToDo details more human-readable #40

Open Belgand opened 12 years ago

Belgand commented 12 years ago

When we display the status field we're just displaying what's stored in the ToDoItem object which is the machine-readable version, not the human-friendly one. This is because this field was defined through a set of choices in the model that list both a machine-readable and a human-readable option for each choice.

The model should already have a method available to access the human-readable name. Track down this method and use it on the details page for the status.

Documentation: choices

Belgand commented 12 years ago

The code you referenced is broken in a couple of ways. I've elaborated on most of these in your commit. I'm reverting the commit out because it also includes some changes that don't really implement the best solution to the problem. We don't need to change the model at all. There's a method that we can call to get the human-readable part of the choices as defined. Please re-read the issue and check the listed documentation.

If you can't find it easily while reading the docs on choices this link should take you right to the method you need to use, but it's important to understand how choices work as well as just the correct method.