Browse Source

Alteração de alguns models

0.3
Camilo Carlos (Estagiario) 15 years ago
parent
commit
83674af34c
  1. 7
      sigi/apps/casas/admin.py
  2. 2
      sigi/apps/convenios/admin.py
  3. 11
      sigi/apps/convenios/models.py

7
sigi/apps/casas/admin.py

@ -4,6 +4,7 @@ from django.contrib.contenttypes import generic
from sigi.apps.casas.forms import CasaLegislativaForm
from sigi.apps.casas.models import CasaLegislativa
from sigi.apps.contatos.models import Contato, Telefone
from sigi.apps.convenios.models import Convenio, EquipamentoPrevisto, Anexo
class ContatosInline(generic.GenericTabularInline):
model = Contato
@ -14,11 +15,15 @@ class TelefonesInline(generic.GenericTabularInline):
model = Telefone
extra = 2
class ConveniosInline(admin.TabularInline):
model = Convenio
extra =0
class CasaLegislativaAdmin(admin.ModelAdmin):
form = CasaLegislativaForm
change_form_template = 'casas/change_form.html'
change_list_template = 'casas/change_list.html'
inlines = (TelefonesInline, ContatosInline)
inlines = (TelefonesInline, ContatosInline, ConveniosInline)
list_display = ('nome', 'email', 'pagina_web', 'municipio')
list_display_links = ('nome',)
list_filter = ('tipo', 'municipio')

2
sigi/apps/convenios/admin.py

@ -25,7 +25,7 @@ class ConvenioAdmin(admin.ModelAdmin):
change_list_template = 'convenios/change_list.html'
fieldsets = (
(None,
{'fields': ('casa_legislativa', 'num_processo_sf')}
{'fields': ('casa_legislativa', 'num_processo_sf','tipo_convenio')}
),
('Datas',
{'fields': ('data_adesao', 'data_retorno_assinatura',

11
sigi/apps/convenios/models.py

@ -1,9 +1,15 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from django.db import models
#from django.contrib.contenttypes import ContentType
from django.contrib.contenttypes import generic
class Convenio(models.Model):
CONVENIO_TIPO = (
('PI', 'Programa Interlegis'),
('PPL', 'Projeto Piloto de Modernização'),
('PML', 'Projeto Modernização Legislaivo')
)
casa_legislativa = models.ForeignKey(
'casas.CasaLegislativa',
verbose_name='Casa Legislativa'
@ -19,6 +25,10 @@ class Convenio(models.Model):
null=True,
blank=True,
)
tipo_convenio = models.CharField(
max_length=10,
choices=CONVENIO_TIPO
)
data_retorno_assinatura = models.DateField(
'data do retorno e assinatura',
null=True,
@ -47,6 +57,7 @@ class Convenio(models.Model):
null=True,
blank=True,
)
#content_type = models.ForeignKey(ContentType)
class Meta:
get_latest_by = 'id'

Loading…
Cancel
Save