5
두 가지 형태의 동일한 모델을 사용하고 필드의 라벨을 변경하고 싶습니다. 라벨을 어떻게 바꿀 수 있습니까?필드 라벨 싱싱한 형태의 장고
이 내 한 형태입니다 :
class jobpostForm(forms.ModelForm):
class Meta:
model = jobpost
fields = ('job_type','title','company_name','location','country','description','start_date','end_date','how_to_apply')
widgets = {
'job_type':RadioSelect(),
'location':TextInput(attrs={'size':'70','cols': 10, 'rows': 20}),
'description': TinyMCE(attrs={'cols':'100', 'row': '80'}),
'start_date':AdminDateWidget(attrs={'readonly':'readonly'}),
'end_date':AdminDateWidget(attrs={'readonly':'readonly'}),
'how_to_apply':RadioSelect(),
}
def __init__(self, *args, **kwargs):
super(jobpostForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_class = 'horizontal-form'
self.helper.form_id = 'id-jobpostform'
self.helper.form_class = 'blueForms'
self.helper.form_method = 'post'
self.helper.form_action = '/portal/next/post/'
self.helper.add_input(Submit(_('submit_addcontent'), 'Preview'))
super(jobpostForm, self).__init__(*args, **kwargs)
나는이 작업을 수행 할 수있는 방법 .. '작업 위치'에 '위치'를 변경하려는처럼?
이 작업을 수행하고 있지만 레이블이 변경되지 않습니다. –
서식 파일에 양식 (필드)을 어떻게 표시하고 있습니까? – arie
{% crispy form %}와 같은 전체 양식을 표시합니다 –