开发者

How to format Form Field title with the appropriate currency in Python/Django?

I have a a form where a form field's title includes a currency amount

class MyForm(form.Forms):
     currency_field = forms.BooleanField()

def __init__(self, *args, **kwargs):
     super(MyForm, self).__init__(*args开发者_C百科, **kwargs)
     self.fields['currency_field'].widget.attrs = {'title':'By checking this field, you can avail our services for $75'}

You can see that I have hardcoded $75 into this. Is there way to format this in the local currency.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜