diff --git a/sigi/apps/servidores/admin.py b/sigi/apps/servidores/admin.py index dcd9ece..7e45acf 100644 --- a/sigi/apps/servidores/admin.py +++ b/sigi/apps/servidores/admin.py @@ -45,12 +45,19 @@ class ServicoAdmin(admin.ModelAdmin): class ServidorAdmin(BaseModelAdmin): list_display = ('imagem_foto', 'nome_completo', 'is_active', 'servico', ) list_display_links = ('imagem_foto', 'nome_completo',) - list_filter = ('user__is_active', 'servico',) + list_filter = ('user__is_active', 'externo', 'servico') search_fields = ('nome_completo', 'user__email', 'user__first_name', 'user__last_name', 'user__username', 'servico__nome', 'servico__sigla') raw_id_fields = ('user',) - fields = ['user', 'nome_completo', 'foto', 'servico',] + fieldsets = ( + (None, { + 'fields': ('user', 'nome_completo', 'foto', 'servico',) + }), + (_(u"outros órgãos"), { + 'fields': ('externo', 'orgao_origem', 'qualificacoes'), + }), + ) def lookup_allowed(self, lookup, value): return super(ServidorAdmin, self).lookup_allowed(lookup, value) or \ diff --git a/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py b/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py new file mode 100644 index 0000000..d6c5300 --- /dev/null +++ b/sigi/apps/servidores/migrations/0007_auto_20210430_0735.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('servidores', '0006_auto_20210429_0822'), + ] + + operations = [ + migrations.AddField( + model_name='servidor', + name='externo', + field=models.BooleanField(default=False, verbose_name='colaborador externo'), + preserve_default=True, + ), + migrations.AddField( + model_name='servidor', + name='orgao_origem', + field=models.CharField(max_length=100, verbose_name='\xf3rg\xe3o de origem, ', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='servidor', + name='qualificacoes', + field=models.TextField(verbose_name='qualifica\xe7\xf5es', blank=True), + preserve_default=True, + ), + ] diff --git a/sigi/apps/servidores/models.py b/sigi/apps/servidores/models.py index 97f518d..db80fee 100644 --- a/sigi/apps/servidores/models.py +++ b/sigi/apps/servidores/models.py @@ -54,6 +54,12 @@ class Servidor(models.Model): blank=True, null=True ) + externo = models.BooleanField(_(u"colaborador externo"), default=False) + orgao_origem = models.CharField( + _(u"órgão de origem, "), + max_length=100, blank=True + ) + qualificacoes = models.TextField(_(u"qualificações"), blank=True) class Meta: ordering = ('nome_completo',)