开发者

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

开发者 https://www.devze.com 2023-03-03 12:10 出处:网络
I have a a form where a form field\'s title includes a currency amount class MyForm(form.Forms): currency_field = forms.BooleanField()

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

精彩评论

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