djangosnippets.org: Latest snippets tagged with 'brazil'https://djangosnippets.org/tags/brazil/2011-01-11T16:27:44.210030-06:00Campo para Validar CPF ou CNPJ Brasileiro
2011-01-11T16:27:44.210030-06:00dudushttps://djangosnippets.org/snippets/2318/<p>I basically mixed both BRCPFField and BRCNPJField to create a widget that validates either an CPF or an CNPJ. The doc strings are not localized. So you probably have to hardcode it yourself.</p>
Freely redistributableConvert numbers in USA notation to brazilian notation
2008-10-07T14:13:25.702589-05:00eOlivahttps://djangosnippets.org/snippets/1115/<p><strong>This is the converter, just put it as a filter and call it with a float number.</strong></p>
<ul>
<li>So, if you have a template variable <strong>{{ my_number }}</strong> that is "3096.44".</li>
<li>It will convert to "3.096,44" using the filter <strong>{{ my_number|numBR }}</strong>.</li>
</ul>
Freely redistributable