Browse Source

Ajuste de warnings do Django 1.7: ModelForms usando todos os campos

Em tese esta nao eh uma boa pratica. Deveriamos listar explicitamente todos os campos em cada caso
producao
Marcio Mazza 10 years ago
parent
commit
20197f464d
  1. 1
      sigi/apps/casas/forms.py
  2. 1
      sigi/apps/diagnosticos/forms.py
  3. 1
      sigi/apps/servicos/admin.py
  4. 3
      sigi/apps/servidores/forms.py

1
sigi/apps/casas/forms.py

@ -15,3 +15,4 @@ class CasaLegislativaForm(forms.ModelForm):
class Meta:
model = CasaLegislativa
fields = '__all__'

1
sigi/apps/diagnosticos/forms.py

@ -64,6 +64,7 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm):
}
class Meta:
model = Diagnostico
fields = '__all__'
def __init__(self, data=None, category=None, *args, **kwargs):
super(BaseDynamicEntityForm, self).__init__(data, *args, **kwargs)

1
sigi/apps/servicos/admin.py

@ -19,6 +19,7 @@ class LogServicoInline(admin.StackedInline):
class ServicoFormAdmin(ModelForm):
class Meta:
model = Servico
fields = '__all__'
def __init__(self, *args, **kwargs):
super(ServicoFormAdmin, self).__init__(*args, **kwargs)

3
sigi/apps/servidores/forms.py

@ -10,6 +10,7 @@ from sigi.apps.servidores.models import Ferias, Licenca, Funcao, Servidor
class FeriasForm(forms.ModelForm):
class Meta:
model = Ferias
fields = '__all__'
def clean(self):
data = self.cleaned_data
@ -22,6 +23,7 @@ class FeriasForm(forms.ModelForm):
class LicencaForm(forms.ModelForm):
class Meta:
model = Licenca
fields = '__all__'
def clean(self):
data = self.cleaned_data
@ -34,6 +36,7 @@ class LicencaForm(forms.ModelForm):
class FuncaoForm(forms.ModelForm):
class Meta:
model = Funcao
fields = '__all__'
def clean(self):
data = self.cleaned_data

Loading…
Cancel
Save