﻿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
24888	A charfield with options shows with short tags in stead of verbose name in a modelform	Wim Feijen	nobody	"Suppose you have a charfield in your model which has several choices defined. When you create a form from this model, the form shows the short tags as options (which are used for database storage) in stead of the verbose name (get_xxx_display) which should be used by default for displaying, in my opinion. 

Example:


{{{
FURNISHING = (
    (""yes"", _(""Furnished"")),
    (""no"", _(""Unfurnished"")),
    (""bare"", _(""Bare"")),
)

class Room(TimeStamped):
    ...
    furnishing = models.CharField(verbose_name=_(""furnishing""), max_length=10, choices=FURNISHING, default='no')
    ...

FIELDS = [..., 'furnishing', ...]

class RoomForm(forms.ModelForm):
    class Meta:
        model = Room
        fields = FIELDS
        widgets = {
            'furnishing': forms.RadioSelect(),
        }

}}}

(A workaround is to use the verbose names as char tags in the database. However, this does not work in a multilingual environment.)"	Uncategorized	closed	Forms	1.8	Normal	worksforme			Unreviewed	0	0	0	0	0	0
