Browse Source

Alterações para inclusão do serviço de hospedagem de domínios .leg.br

diagnosticos
Sesostris Vieira 13 years ago
parent
commit
541acfe2d9
  1. 12
      sigi/apps/servicos/admin.py
  2. 24
      sigi/apps/servicos/models.py
  3. 14
      sigi/settings.py
  4. 3
      sigi/sites.py

12
sigi/apps/servicos/admin.py

@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
from django.contrib import admin
from django.contrib.contenttypes import generic
from sigi.apps.contatos.models import Contato
from sigi.apps.servicos.models import Servico
from sigi.apps.servicos.models import DominioLeg
class ContatosInline(generic.GenericTabularInline):
model = Contato
@ -18,5 +20,11 @@ class ServicoAdmin(admin.ModelAdmin):
list_filter = ('tipo','situacao', 'avaliacao')
raw_id_fields = ('convenio',)
search_fields = ('titulo', 'tipo', 'descricao')
admin.site.register(Servico, ServicoAdmin)
class DominiolegAdmin(admin.ModelAdmin):
model = DominioLeg
date_hierarchy = 'data_preenchimento'
list_display = ('id', 'dominio', 'contato_administrativo', 'contato_tecnico', 'data_preenchimento', 'data_recebimento', 'data_atendimento',)
search_fields = ('dominio',)
admin.site.register(DominioLeg, DominiolegAdmin)
admin.site.register(Servico, ServicoAdmin)

24
sigi/apps/servicos/models.py

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.contenttypes import generic
from apps.casas.models import CasaLegislativa
from datetime import date
class Servico(models.Model):
SITUACAO_CHOICES = (
@ -52,3 +54,25 @@ class Servico(models.Model):
def __unicode__(self):
return str(self.titulo)
class DominioLeg(models.Model):
casa_legislativa = models.OneToOneField(CasaLegislativa)
dominio = models.URLField('Domínio', verify_exists=False)
contato_administrativo = models.CharField('Contato administrativo', max_length=60)
telefone_administrativo = models.CharField('Telefone administrativo', max_length=10, help_text='Somente números: ddaaaannnn.')
email_administrativo = models.EmailField('e-mail')
contato_tecnico = models.CharField('Contato técnico', max_length=60)
telefone_tecnico = models.CharField('Telefone administrativo', max_length=10, help_text='Somente números: ddaaaannnn.')
email_tecnico = models.EmailField('e-mail')
data_preenchimento = models.DateField('Data de preenchimento', default=date.today)
data_recebimento = models.DateField('Data de recebimento', null=True, blank=True)
data_atendimento = models.DateField('Data de atendimento', null=True, blank=True)
class Meta:
verbose_name = 'Registro de domínio .leg.br'
verbose_name_plural = 'Registros de domínios .leg.br'
def __unicode__(self):
return str(self.dominio)

14
sigi/settings.py

@ -29,13 +29,13 @@ DEFAULT_FROM_EMAIL = 'noreply@localhost'
INTERNAL_IPS = ('127.0.0.1',)
DATABASE_ENGINE = 'postgresql_psycopg2'
#DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'sigi'
DATABASE_USER = 'administrador'
DATABASE_PASSWORD = 'interlegis'
DATABASE_HOST = '10.1.10.44'
DATABASE_PORT = '5432'
#DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'devel.db'
#DATABASE_USER = 'sigi'
#DATABASE_PASSWORD = '123456'
#DATABASE_HOST = 'localhost'
#DATABASE_PORT = '5432'
TIME_ZONE = 'Brazil/East'
LANGUAGE_CODE = 'pt-br'

3
sigi/sites.py

@ -13,7 +13,7 @@ from sigi.apps.inventario.admin import (Fornecedor, FornecedorAdmin, Fabricante,
EquipamentoAdmin, TipoEquipamento,
TipoEquipamentoAdmin, ModeloEquipamento,
ModeloEquipamentoAdmin, Bem, BemAdmin)
from sigi.apps.servicos.admin import Servico, ServicoAdmin
from sigi.apps.servicos.admin import Servico, ServicoAdmin, DominioLeg, DominiolegAdmin
from sigi.apps.mesas.admin import (Legislatura, LegislaturaAdmin, Coligacao,
ColigacaoAdmin, ComposicaoColigacao,
ComposicaoColigacaoAdmin, SessaoLegislativa,
@ -67,6 +67,7 @@ default.register(Bem, BemAdmin)
# sigi.apps.servicos
default.register(Servico, ServicoAdmin)
default.register(DominioLeg, DominiolegAdmin)
# sigi.apps.mesas
default.register(Legislatura, LegislaturaAdmin)

Loading…
Cancel
Save