Skip to content

Instantly share code, notes, and snippets.

@gileno
Created January 15, 2012 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gileno/1615926 to your computer and use it in GitHub Desktop.
Save gileno/1615926 to your computer and use it in GitHub Desktop.
Decimal Separator Django
from django import forms
class NivelParcelaHabitanteForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(NivelParcelaHabitanteForm, self).__init__(*args, **kwargs)
self.fields['i'].localize = True
self.fields['i'].widget.is_localized = True
self.fields['ii'].localize = True
self.fields['ii'].widget.is_localized = True
# o resto dos fields .....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment