diff --git a/sigi/apps/convenios/admin.py b/sigi/apps/convenios/admin.py index e9b3cdf..fc1cad5 100644 --- a/sigi/apps/convenios/admin.py +++ b/sigi/apps/convenios/admin.py @@ -6,16 +6,13 @@ from sigi.apps.servicos.models import Servico class AnexosInline(admin.TabularInline): model = Anexo extra = 2 + exclude = ['data_pub',] class EquipamentoPrevistoInline(admin.TabularInline): model = EquipamentoPrevisto extra = 2 raw_id_fields = ('equipamento',) -class ServicosInline(admin.StackedInline): - model = Servico - extra = 1 - class AnexoAdmin(admin.ModelAdmin): date_hierarchy = 'data_pub' exclude = ['data_pub',] @@ -38,7 +35,7 @@ class ConvenioAdmin(admin.ModelAdmin): {'fields': ('equipamentos_recebidos',)} ) ) - inlines = (AnexosInline, EquipamentoPrevistoInline, ServicosInline) + inlines = (AnexosInline, EquipamentoPrevistoInline) list_display = ('num_convenio', 'casa_legislativa', 'num_processo_sf', 'data_adesao') list_filter = ('equipamentos_recebidos',) diff --git a/sigi/apps/convenios/models.py b/sigi/apps/convenios/models.py index 6eeb9ba..7bcbdac 100644 --- a/sigi/apps/convenios/models.py +++ b/sigi/apps/convenios/models.py @@ -13,10 +13,15 @@ class Convenio(models.Model): 'casas.CasaLegislativa', verbose_name='Casa Legislativa' ) - num_convenio = models.PositiveIntegerField('número do convênio') + num_convenio = models.PositiveIntegerField( + 'número do convênio', + primary_key=True, + unique=True + ) num_processo_sf = models.CharField( 'número do processo SF', max_length=11, + blank=True, help_text='Formato: XXXXXX/XX-X.' ) data_adesao = models.DateField('data de adesão')