Skip to content

Instantly share code, notes, and snippets.

@fellipeh
Created October 28, 2013 11:32
Show Gist options
  • Save fellipeh/7195319 to your computer and use it in GitHub Desktop.
Save fellipeh/7195319 to your computer and use it in GitHub Desktop.
Form Caixa
class CRForm(ModelForm):
class Meta:
model = ContaReceber
def __init__(self, *args, **kwargs):
vUserProfile = kwargs.pop('vUserProfile', None)
super(CRForm, self).__init__(*args, **kwargs)
self.fields["dthr_cadastro"].widget.attrs['readonly'] = "True"
self.fields["valor"].localize = True
self.fields["valor"].widget.is_localized = True
self.fields["valor"].widget.attrs['class'] = "mascdecimal2"
self.fields["cliente"].widget.attrs['class'] = "chosen-select-no-results"
self.fields["sistema"].widget.attrs['class'] = "chosen-select-no-results"
def clean_dthr_cadastro(self):
data = datetime.now()
return data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment