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. 8
      sigi/apps/servicos/admin.py
  2. 24
      sigi/apps/servicos/models.py
  3. 14
      sigi/settings.py
  4. 3
      sigi/sites.py

8
sigi/apps/servicos/admin.py

@ -1,8 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.contrib import admin from django.contrib import admin
from django.contrib.contenttypes import generic from django.contrib.contenttypes import generic
from sigi.apps.contatos.models import Contato from sigi.apps.contatos.models import Contato
from sigi.apps.servicos.models import Servico from sigi.apps.servicos.models import Servico
from sigi.apps.servicos.models import DominioLeg
class ContatosInline(generic.GenericTabularInline): class ContatosInline(generic.GenericTabularInline):
model = Contato model = Contato
@ -18,5 +20,11 @@ class ServicoAdmin(admin.ModelAdmin):
list_filter = ('tipo','situacao', 'avaliacao') list_filter = ('tipo','situacao', 'avaliacao')
raw_id_fields = ('convenio',) raw_id_fields = ('convenio',)
search_fields = ('titulo', 'tipo', 'descricao') search_fields = ('titulo', 'tipo', 'descricao')
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) admin.site.register(Servico, ServicoAdmin)

24
sigi/apps/servicos/models.py

@ -1,6 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.db import models from django.db import models
from django.contrib.contenttypes import generic from django.contrib.contenttypes import generic
from apps.casas.models import CasaLegislativa
from datetime import date
class Servico(models.Model): class Servico(models.Model):
SITUACAO_CHOICES = ( SITUACAO_CHOICES = (
@ -52,3 +54,25 @@ class Servico(models.Model):
def __unicode__(self): def __unicode__(self):
return str(self.titulo) 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',) INTERNAL_IPS = ('127.0.0.1',)
DATABASE_ENGINE = 'postgresql_psycopg2' #DATABASE_ENGINE = 'postgresql_psycopg2'
#DATABASE_ENGINE = 'sqlite3' DATABASE_ENGINE = 'sqlite3'
DATABASE_NAME = 'sigi' DATABASE_NAME = 'devel.db'
DATABASE_USER = 'administrador' #DATABASE_USER = 'sigi'
DATABASE_PASSWORD = 'interlegis' #DATABASE_PASSWORD = '123456'
DATABASE_HOST = '10.1.10.44' #DATABASE_HOST = 'localhost'
DATABASE_PORT = '5432' #DATABASE_PORT = '5432'
TIME_ZONE = 'Brazil/East' TIME_ZONE = 'Brazil/East'
LANGUAGE_CODE = 'pt-br' LANGUAGE_CODE = 'pt-br'

3
sigi/sites.py

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

Loading…
Cancel
Save