diff --git a/project/app/__pycache__/__init__.cpython-38.pyc b/project/app/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..81e045f1 Binary files /dev/null and b/project/app/__pycache__/__init__.cpython-38.pyc differ diff --git a/project/app/__pycache__/admin.cpython-38.pyc b/project/app/__pycache__/admin.cpython-38.pyc new file mode 100644 index 00000000..14dbe7c3 Binary files /dev/null and b/project/app/__pycache__/admin.cpython-38.pyc differ diff --git a/project/app/__pycache__/apps.cpython-38.pyc b/project/app/__pycache__/apps.cpython-38.pyc new file mode 100644 index 00000000..90c6fbe2 Binary files /dev/null and b/project/app/__pycache__/apps.cpython-38.pyc differ diff --git a/project/app/__pycache__/models.cpython-38.pyc b/project/app/__pycache__/models.cpython-38.pyc new file mode 100644 index 00000000..01e2940d Binary files /dev/null and b/project/app/__pycache__/models.cpython-38.pyc differ diff --git a/project/app/__pycache__/urls.cpython-38.pyc b/project/app/__pycache__/urls.cpython-38.pyc new file mode 100644 index 00000000..81340c25 Binary files /dev/null and b/project/app/__pycache__/urls.cpython-38.pyc differ diff --git a/project/app/__pycache__/views.cpython-38.pyc b/project/app/__pycache__/views.cpython-38.pyc new file mode 100644 index 00000000..2cc9dadd Binary files /dev/null and b/project/app/__pycache__/views.cpython-38.pyc differ diff --git a/project/app/migrations/0001_initial.py b/project/app/migrations/0001_initial.py new file mode 100644 index 00000000..37a41f51 --- /dev/null +++ b/project/app/migrations/0001_initial.py @@ -0,0 +1,95 @@ +# Generated by Django 4.2.5 on 2023-10-06 17:38 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Export', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('data_export', models.DateTimeField(auto_now_add=True)), + ('formato', models.CharField(max_length=200)), + ('nome_template', models.CharField(max_length=200)), + ('nome_usuario', models.CharField(max_length=200)), + ('id_projeto', models.CharField(max_length=200)), + ], + ), + migrations.CreateModel( + name='Mapeamento', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('CODIGO', models.CharField(max_length=70)), + ('NOME', models.CharField(max_length=70)), + ('SALDO', models.CharField(max_length=70)), + ('DATA_ASSINATURA', models.CharField(max_length=70)), + ('DATA_VIGENCIA', models.CharField(max_length=70)), + ('DATA_ENCERRAMENTO', models.CharField(max_length=70)), + ('TIPO_CONTRATO', models.CharField(max_length=70)), + ('INSTITUICAO_EXECUTORA', models.CharField(max_length=70)), + ('PROCESSO', models.CharField(max_length=70)), + ('SUBPROCESSO', models.CharField(max_length=70)), + ('COD_PROPOSTA', models.CharField(max_length=70)), + ('PROPOSTA', models.CharField(max_length=70)), + ('OBJETIVOS', models.CharField(max_length=70)), + ('VALOR_APROVADO', models.CharField(max_length=70)), + ('NOME_TP_CONTROLE_SALDO', models.CharField(max_length=70)), + ('GRUPO_GESTORES', models.CharField(max_length=70)), + ('GESTOR_RESP', models.CharField(max_length=70)), + ('COORDENADOR', models.CharField(max_length=70)), + ('PROCEDIMENTO_COMPRA', models.CharField(max_length=70)), + ('TAB_FRETE', models.CharField(max_length=70)), + ('TAB_DIARIAS', models.CharField(max_length=70)), + ('CUSTO_OP', models.CharField(max_length=70)), + ('NOME_FINANCIADOR', models.CharField(max_length=70)), + ('DEPARTAMENTO', models.CharField(max_length=70)), + ('SITUACAO', models.CharField(max_length=70)), + ('BANCO', models.CharField(max_length=70)), + ('AGENCIA_BANCARIA', models.CharField(max_length=70)), + ('CONTA_BANCARIA', models.CharField(max_length=70)), + ('CENTRO_CUSTO', models.CharField(max_length=70)), + ('CONTA_CAIXA', models.CharField(max_length=70)), + ('CATEGORIA_PROJETO', models.CharField(max_length=70)), + ('COD_CONVENIO_CONTA', models.CharField(max_length=70)), + ('COD_STATUS', models.CharField(max_length=70)), + ('IND_SUB_PROJETO', models.CharField(max_length=70)), + ('TIPO_CUSTO_OP', models.CharField(max_length=70)), + ('PROJETO_MAE', models.CharField(max_length=70)), + ('ID_COORDENADOR', models.CharField(max_length=70)), + ('ID_FINANCIADOR', models.CharField(max_length=70)), + ('ID_INSTITUICAO', models.CharField(max_length=70)), + ('ID_DEPARTAMENTO', models.CharField(max_length=70)), + ('NOME_INSTITUICAO', models.CharField(max_length=70)), + ('ID_INSTITUICAO_EXECUTORA', models.CharField(max_length=70)), + ('ID_TIPO', models.CharField(max_length=70)), + ], + ), + migrations.CreateModel( + name='Report', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('titulo', models.CharField(max_length=200)), + ('descricao', models.CharField(max_length=200)), + ('tipo_erro', models.CharField(max_length=200)), + ('id_projeto', models.CharField(max_length=200)), + ('nome_usuario', models.CharField(max_length=200)), + ], + ), + migrations.CreateModel( + name='Template', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome_template', models.CharField(max_length=200)), + ('endereco_template', models.CharField(max_length=200)), + ('mapeamento', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.mapeamento')), + ], + ), + ] diff --git a/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py b/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py new file mode 100644 index 00000000..d727ce52 --- /dev/null +++ b/project/app/migrations/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.py @@ -0,0 +1,213 @@ +# Generated by Django 4.2.5 on 2023-10-07 01:15 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='mapeamento', + old_name='AGENCIA_BANCARIA', + new_name='agencia_bancaria', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='BANCO', + new_name='banco', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CATEGORIA_PROJETO', + new_name='categoria_projeto', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CENTRO_CUSTO', + new_name='centro_custo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CODIGO', + new_name='codigo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CONTA_BANCARIA', + new_name='conta_bancaria', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CONTA_CAIXA', + new_name='conta_caixa', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='COORDENADOR', + new_name='coordenador', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='CUSTO_OP', + new_name='custo_op', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='DATA_ASSINATURA', + new_name='data_assinatura', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='DATA_ENCERRAMENTO', + new_name='data_encerramento', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='DATA_VIGENCIA', + new_name='data_vigencia', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='DEPARTAMENTO', + new_name='departamento', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='GESTOR_RESP', + new_name='gestor_resp', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='GRUPO_GESTORES', + new_name='grupo_gestores', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_COORDENADOR', + new_name='id_coordenador', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_DEPARTAMENTO', + new_name='id_departamento', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_FINANCIADOR', + new_name='id_financiador', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_INSTITUICAO', + new_name='id_instituicao', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_INSTITUICAO_EXECUTORA', + new_name='id_instituicao_executora', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='ID_TIPO', + new_name='id_tipo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='IND_SUB_PROJETO', + new_name='ind_sub_projeto', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='INSTITUICAO_EXECUTORA', + new_name='instituicao_executora', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='NOME', + new_name='nome', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='NOME_FINANCIADOR', + new_name='nome_financiador', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='NOME_INSTITUICAO', + new_name='nome_instituicao', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='NOME_TP_CONTROLE_SALDO', + new_name='nome_tp_controle_saldo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='OBJETIVOS', + new_name='objetivos', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='PROCEDIMENTO_COMPRA', + new_name='procedimento_compra', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='PROCESSO', + new_name='processo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='PROJETO_MAE', + new_name='projeto_mae', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='PROPOSTA', + new_name='proposta', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='SALDO', + new_name='saldo', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='SITUACAO', + new_name='situacao', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='SUBPROCESSO', + new_name='subprocesso', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='TAB_DIARIAS', + new_name='tab_diarias', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='TAB_FRETE', + new_name='tab_frete', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='TIPO_CONTRATO', + new_name='tipo_contrato', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='TIPO_CUSTO_OP', + new_name='tipo_custo_op', + ), + migrations.RenameField( + model_name='mapeamento', + old_name='VALOR_APROVADO', + new_name='valor_aprovado', + ), + ] diff --git a/project/app/migrations/__pycache__/0001_initial.cpython-38.pyc b/project/app/migrations/__pycache__/0001_initial.cpython-38.pyc new file mode 100644 index 00000000..5cbd38d2 Binary files /dev/null and b/project/app/migrations/__pycache__/0001_initial.cpython-38.pyc differ diff --git a/project/app/migrations/__pycache__/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.cpython-38.pyc b/project/app/migrations/__pycache__/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.cpython-38.pyc new file mode 100644 index 00000000..046e2c8d Binary files /dev/null and b/project/app/migrations/__pycache__/0002_rename_agencia_bancaria_mapeamento_agencia_bancaria_and_more.cpython-38.pyc differ diff --git a/project/app/migrations/__pycache__/__init__.cpython-38.pyc b/project/app/migrations/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..e2743d47 Binary files /dev/null and b/project/app/migrations/__pycache__/__init__.cpython-38.pyc differ diff --git a/project/app/models.py b/project/app/models.py index 71a83623..85a456a5 100644 --- a/project/app/models.py +++ b/project/app/models.py @@ -1,3 +1,72 @@ from django.db import models -# Create your models here. +class Mapeamento(models.Model): + id_mapeamento = models.IntegerField(primary_key=True) + codigo = models.CharField(max_length=200) + nome = models.CharField(max_length=200) + saldo = models.CharField(max_length=200) + data_assinatura = models.CharField(max_length=200) + data_vigencia = models.CharField(max_length=200) + data_encerramento = models.CharField(max_length=200) + tipo_contrato = models.CharField(max_length=200) + instituicao_executora = models.CharField(max_length=200) + processo = models.CharField(max_length=200) + subprocesso = models.CharField(max_length=200) + cod_proposta = models.CharField(max_length=200) + proposta = models.CharField(max_length=200) + objetivos = models.CharField(max_length=200) + valor_aprovado = models.CharField(max_length=200) + nome_tp_controle_saldo = models.CharField(max_length=200) + grupo_gestores = models.CharField(max_length=200) + gestor_resp = models.CharField(max_length=200) + coordenador = models.CharField(max_length=200) + procedimento_compra = models.CharField(max_length=200) + tab_frete = models.CharField(max_length=200) + tab_diarias = models.CharField(max_length=200) + custo_op = models.CharField(max_length=200) + nome_financiador = models.CharField(max_length=200) + departamento = models.CharField(max_length=200) + situacao = models.CharField(max_length=200) + banco = models.CharField(max_length=200) + agencia_bancaria = models.CharField(max_length=200) + conta_bancaria = models.CharField(max_length=200) + centro_custo = models.CharField(max_length=200) + conta_caixa = models.CharField(max_length=200) + categoria_projeto = models.CharField(max_length=200) + cod_convenio_conta = models.CharField(max_length=200) + cod_status = models.CharField(max_length=200) + ind_sub_projeto = models.CharField(max_length=200) + tipo_custo_op = models.CharField(max_length=200) + projeto_mae = models.CharField(max_length=200) + id_coordenador = models.CharField(max_length=200) + id_financiador = models.CharField(max_length=200) + id_instituicao = models.CharField(max_length=200) + id_departamento = models.CharField(max_length=200) + nome_instituicao = models.CharField(max_length=200) + id_instituicao_executora = models.CharField(max_length=200) + id_tipo = models.CharField(max_length=200) + +class Template(models.Model): + nome_template = models.CharField(max_length=200) + endereco_template = models.CharField(max_length=200) + mapeamento = models.ForeignKey(Mapeamento, on_delete=models.CASCADE) + +class Report(models.Model): + titulo = models.CharField(max_length=200) + descricao = models.CharField(max_length=200) + + TIPO_ERRO_CHOICES = ( + ('erro1', 'Falta de informação no projeto'), + ('erro2', 'Campo preenchido incorretamente'), + # Adicione mais opções conforme necessário + ) + tipo_erro = models.CharField(max_length=20, choices=TIPO_ERRO_CHOICES) + id_projeto = models.CharField(max_length=50) + nome_usuario = models.CharField(max_length=200) + +class Export(models.Model): + data_export = models.DateTimeField(auto_now_add=True) + formato = models.CharField(max_length=200) + nome_template = models.CharField(max_length=200) + nome_usuario = models.CharField(max_length=200) + id_projeto = models.CharField(max_length=50) diff --git a/project/project/__pycache__/__init__.cpython-38.pyc b/project/project/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 00000000..5ab4e9c7 Binary files /dev/null and b/project/project/__pycache__/__init__.cpython-38.pyc differ diff --git a/project/project/__pycache__/settings.cpython-38.pyc b/project/project/__pycache__/settings.cpython-38.pyc new file mode 100644 index 00000000..bb634982 Binary files /dev/null and b/project/project/__pycache__/settings.cpython-38.pyc differ diff --git a/project/project/__pycache__/urls.cpython-38.pyc b/project/project/__pycache__/urls.cpython-38.pyc new file mode 100644 index 00000000..6d4bb4ce Binary files /dev/null and b/project/project/__pycache__/urls.cpython-38.pyc differ diff --git a/project/project/populando_banco.py b/project/project/populando_banco.py new file mode 100644 index 00000000..05c75224 --- /dev/null +++ b/project/project/populando_banco.py @@ -0,0 +1,50 @@ +from app.models import Mapeamento + +# fundep +mapa = Mapeamento( + CODIGO = "", + NOME = "'Receita x Despesa';'Título do Projeto: ';A3", + SALDO = "", + DATA_ASSINATURA = "", + DATA_VIGENCIA = "", + DATA_ENCERRAMENTO = "", + TIPO_CONTRATO = "", + INSTITUICAO_EXECUTORA = "", + PROCESSO = "", + SUBPROCESSO = "", + COD_PROPOSTA = "", + PROPOSTA = "", + OBJETIVOS = "", + VALOR_APROVADO = "", + NOME_TP_CONTROLE_SALDO = "", + GRUPO_GESTORES = "", + GESTOR_RESP = "", + COORDENADOR = "", + PROCEDIMENTO_COMPRA = "", + TAB_FRETE = "", + TAB_DIARIAS = "", + CUSTO_OP = "", + NOME_FINANCIADOR = "", + DEPARTAMENTO = "", + SITUACAO = "", + BANCO = "", + AGENCIA_BANCARIA = "", + CONTA_BANCARIA = "", + CENTRO_CUSTO = "", + CONTA_CAIXA = "", + CATEGORIA_PROJETO = "", + COD_CONVENIO_CONTA = "", + COD_STATUS = "", + IND_SUB_PROJETO = "", + TIPO_CUSTO_OP = "", + PROJETO_MAE = "", + ID_COORDENADOR = "", + ID_FINANCIADOR = "", + ID_INSTITUICAO = "", + ID_DEPARTAMENTO = "", + NOME_INSTITUICAO = "", + ID_INSTITUICAO_EXECUTORA = "", + ID_TIPO = "" +) + +mapa.save() \ No newline at end of file diff --git a/project/project/settings.py b/project/project/settings.py index e6d07cc2..a65cbd22 100644 --- a/project/project/settings.py +++ b/project/project/settings.py @@ -65,9 +65,17 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', - } + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'automatec', + 'USER': 'automauser', + 'PASSWORD': '', + 'HOST': 'localhost', + 'PORT': '', + }, + # 'default': { + # 'ENGINE': 'django.db.backends.sqlite3', + # 'NAME': BASE_DIR / 'db.sqlite3', + # } } # DATABASES = {