﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2136	get_FIELD_display broken under specific conditions	Rudolph Froger	Adrian Holovaty	"Under some conditions the get_FIELD_display method returns the actual value instead of the human readable value.

A combination of these two situations breaks get_FIELD_display:
  * A choices argument on a IntegerField
  * Changing or adding the object via a manipulator

Example:

{{{
M_LIST = ((1, 'Jan'), (2, 'Feb'))
class Test(models.Model):
    month = models.PositiveIntegerField('month', choices=M_LIST)

    def __str__(self):
        return self.get_month_display()

    class Admin:
        pass
}}}

Using this model from the shell is no problem, it works as expected. Using is from the admin interface or any other manipulator reveals the problem, {{{__str__}}} will then return a number (in a string I guess) instead of a string.

I ''guess'' the problem is that the value of the field is still a string instead of an integer, when used inside a manipulator."	defect	closed	Database layer (models, ORM)	dev	normal	duplicate		cmlenz@…	Unreviewed	0	0	0	0	0	0
