Created
July 18, 2018 00:49
-
-
Save walison17/a38cd78cf5f5d3130830da486bb2406b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils import timezone | |
class OcorrenciaForm(ModelForm): | |
class Meta: | |
model = Rg_ocorrencia | |
fields = ['criado_em','unidade', 'titulo', 'descricao'] | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
self.fields['criado_em'].initial = timezone.now() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment