开发者

verbose_name='Home Address'

Hi I am new to Django working on Google App Engine.

class StudentAddress(db.Model):
  name=db.UserProperty()
  address=db.StringProperty(verbose_name='Home Address')

class StudentAddressForm(djangoforms.ModelForm):
  class Meta:
    moddel = StudentAddress  

When the form is displayed, verbose name comes like this : Home address

How do 开发者_StackOverflowI code for the display to come as 'Home Address' instead of 'Home address' ? Please help.


class StudentAddressForm(djangoforms.ModelForm):

  def __init__(self):
    super(StudentAddressForm, self).__init__(*args, **kwargs)
    self.fields['address'].label = 'whatever you like'

  class Meta:
    model = StudentAddress 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜