Can someone tell me if there is a problem with the following approach in terms of the translation?
I am concerned that the verbose name becomes fixed at the point of database migration.
models.py
from django.utils.translation import gettext as _
class UserClient(models.Model):
user = models.OneToOneField(User,related_name='profile_client')
phone_cell = PhoneNumberField(verbose_name=_(u'Phone (Cell)'),null=True,blank=False)
phone_home = PhoneNumberField(verbose_name_(u'Phone (Home)'),null=True,blank=True)
If the above is problematic, is it better to implement the following?
forms.py
class ClientForm(forms.ModelForm):
def __init__(self,*args,**kwargs):
super(ClientForm,self).__init__(*args,**kwargs)
self.fields['phone_cell'].label = _(u'Phone (Cell)')
self.fields['phone_home'].label = _(u'Phone (Home)')