Skip to content

Instantly share code, notes, and snippets.

@walison17
Last active July 19, 2018 17:55
Show Gist options
  • Save walison17/fd8ad0081e7650f45bc97eae8d537e44 to your computer and use it in GitHub Desktop.
Save walison17/fd8ad0081e7650f45bc97eae8d537e44 to your computer and use it in GitHub Desktop.
class PlanForm(forms.ModelForm):
class Meta:
model = Plan
fields = ("price", "title", "description")
def __init__(self, *args, **kwargs):
super().__init__(self, *args, **kwargs)
self.fields["price"].localize = True
# settings.py
USE_L10N = True
DECIMAL_SEPARATOR = ','
NUMBER_GROUPING = 3
USE_THOUSAND_SEPARATOR = True
THOUSAND_SEPARATOR = '.'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment