Skip to content

Instantly share code, notes, and snippets.

@kneipp
Created February 29, 2012 04:30
Show Gist options
  • Save kneipp/1937748 to your computer and use it in GitHub Desktop.
Save kneipp/1937748 to your computer and use it in GitHub Desktop.
Exemplo de Formatação de data no ModelAdmin
# def expiration_date(self):
# return self.expiration_date.strftime("%d/%m/%Y")
# expiration_date.short_description = 'data de vencimento'
#
# def payment_date(self):
# return self.payment_date.strftime("%d/%m/%Y")
# payment_date.short_description = 'data do pagamento'
ou
-- settings.py
USE_L10N = False
DATE_FORMAT = 'd/m/Y'
SHORT_DATE_FORMAT = 'd/m/Y'
DECIMAL_SEPARATOR = ','
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment