我有一个表单,其中表单字段的标题包含货币金额
class MyForm(form.Forms):
currency_field = forms.BooleanField()
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
self.fields['currency_field'].widget.attrs = {'title':'By checking this field, you can avail our services for $75'}
你可以看到我已经硬编码了75美元。有没有办法用当地货币格式化。