Browse Source

Disabilita localização atual

pull/440/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
f5d43d653d
  1. 7
      materia/forms.py
  2. 16
      materia/views.py

7
materia/forms.py

@ -176,6 +176,13 @@ class RelatoriaForm(ModelForm):
return cleaned_data
class Meta:
model = Relatoria
model = Relatoria
fields = ['data_designacao_relator', 'comissao', 'parlamentar',
'data_destituicao_relator', 'tipo_fim_relatoria']
widgets = {'comissao': forms.Select(attrs={'disabled': 'disabled'})}
class TramitacaoForm(ModelForm):

16
materia/views.py

@ -57,7 +57,21 @@ ProposicaoCrud = Crud.build(Proposicao, '')
StatusTramitacaoCrud = Crud.build(StatusTramitacao, 'status_tramitacao')
UnidadeTramitacaoCrud = Crud.build(UnidadeTramitacao, 'unidade_tramitacao')
RelatoriaCrud = MasterDetailCrud.build(Relatoria, 'materia', '')
class RelatoriaCrud(MasterDetailCrud):
model = Relatoria
parent_field = 'materia'
help_path = ''
class CreateView(MasterDetailCrud.CreateView):
form_class = RelatoriaForm
def get_initial(self):
self.initial['comissao'] = 8
return self.initial
class UpdateView(MasterDetailCrud.UpdateView):
form_class = RelatoriaForm
class RelatoriaCrud(MasterDetailCrud):

Loading…
Cancel
Save