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: class Meta:
model = CasaLegislativa model = CasaLegislativa
fields = '__all__'

1
sigi/apps/diagnosticos/forms.py

@ -64,6 +64,7 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm):
} }
class Meta: class Meta:
model = Diagnostico model = Diagnostico
fields = '__all__'
def __init__(self, data=None, category=None, *args, **kwargs): def __init__(self, data=None, category=None, *args, **kwargs):
super(BaseDynamicEntityForm, self).__init__(data, *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 ServicoFormAdmin(ModelForm):
class Meta: class Meta:
model = Servico model = Servico
fields = '__all__'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ServicoFormAdmin, self).__init__(*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 FeriasForm(forms.ModelForm):
class Meta: class Meta:
model = Ferias model = Ferias
fields = '__all__'
def clean(self): def clean(self):
data = self.cleaned_data data = self.cleaned_data
@ -22,6 +23,7 @@ class FeriasForm(forms.ModelForm):
class LicencaForm(forms.ModelForm): class LicencaForm(forms.ModelForm):
class Meta: class Meta:
model = Licenca model = Licenca
fields = '__all__'
def clean(self): def clean(self):
data = self.cleaned_data data = self.cleaned_data
@ -34,6 +36,7 @@ class LicencaForm(forms.ModelForm):
class FuncaoForm(forms.ModelForm): class FuncaoForm(forms.ModelForm):
class Meta: class Meta:
model = Funcao model = Funcao
fields = '__all__'
def clean(self): def clean(self):
data = self.cleaned_data data = self.cleaned_data

Loading…
Cancel
Save