Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tentativa com nova branch #1

Open
wants to merge 1 commit into
base: CRUD
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,43 @@
Este reposítório consiste num projeto de uma série de aplicações web, de interação com banco de dados, registrador de escalas, visualização e geração de métricas, entre outros,
como sistema interno de uma empresa.

Aplicações do Projeto:
## Aplicações do Projeto:

Aplicação DBCT:
## Aplicação DBCT:

- Dashboard com visualizações gráficas interativas de metas;
- Barra de pesquisa em tabelas para filtrar resultados;
- Possibilidade de adicionar, modificar e deletar registros de tabelas;
- Sistema de autenticação de usuário, com interações baseadas em cargo (*role-based*);
- Geração de métricas atualizadas com os dados;

Aplicação ScaleTracker:
## Aplicação ScaleTracker:

- Registro de Escalas numa tabela;
- Visualização da tabela com as escalas dos membros;
- Barra de pesquisa para filtrar resultados;
- Visualizações de horas ao longo da semana;
- Visualização de horas totais;

## Instalação e Configuração

1. Clone o repositório.

'''git clone https://github.com/seu-usuario/seu-projeto.git'''

2. Caso não haja um ambiente virtual, crie um

'''cd ct-project
python -m venv venv'''

3. Ative o ambiente virtual

'''source venv/bin/activate # ou "venv\Scripts\activate" no Windows'''

4. Instale as dependências necessárias

'''pip install -r requirements.txt'''

5. Execute o projeto

''' python manage.py runserver '''
53 changes: 31 additions & 22 deletions ct-project/dashboard/models.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
from django.db import models
from django.contrib.auth.models import User
import datetime
from datetime import datetime
# Create your models here.

class Lead(models.Model):

SINGLE = "SOLTEIRO"
MARRIED = "CASADO"
DIVORCED = "DIVORCIADO"
WIDOWED = "VIÚVO"
DATING = "UNIÃO ESTÁVEL"
STATUS = [
(SINGLE, 'Solteiro(a)'),
(MARRIED, "Casado(a)"),
(DIVORCED, "Divorciado(a)"),
(WIDOWED, "Viúvo(a)"),
(DATING, "União Estável"),
]

first_name = models.CharField(max_length=32, default="")
last_name = models.CharField(max_length=32, default="")
email = models.CharField(max_length=80, default="")
phone = models.CharField(max_length=16, default="")
profession = models.CharField(max_length=30, default="")
marital_status = models.CharField(max_length=15, choices=STATUS, default=SINGLE)

def full_name(self):
return f"{self.first_name} {self.last_name}"

class Client(models.Model):
MALE = "M"
FEMALE = "F"
GENDER = [
SEX = [
(MALE, "Homem"),
(FEMALE, "Mulher")
]
Expand All @@ -32,18 +57,6 @@ class Client(models.Model):
(ESINCOMPLETE, "Ensino Superior Incompleto"),
(ESCOMPLETE, "Ensino Superior Completo"),
]
SINGLE = "SOLTEIRO"
MARRIED = "CASADO"
DIVORCED = "DIVORCIADO"
WIDOWED = "VIÚVO"
DATING = "UNIÃO ESTÁVEL"
STATUS = [
(SINGLE, 'Solteiro(a)'),
(MARRIED, "Casado(a)"),
(DIVORCED, "Divorciado(a)"),
(WIDOWED, "Viúvo(a)"),
(DATING, "União Estável"),
]
UPTO_1 = "1"
UPTO_1_5 = "1,5"
UPTO_6_5 = "6,5"
Expand All @@ -70,29 +83,25 @@ class Client(models.Model):
(D, "D"),
(E, "E"),
]
first_name = models.CharField(max_length=32, default="")
last_name = models.CharField(max_length=32, default="")
gender = models.CharField(max_length=1, choices=GENDER, default="")

sex = models.CharField(max_length=1, choices=SEX, default="")
source = models.CharField(max_length=10, choices=SOURCE, default="")
email = models.CharField(max_length=80, default="")
phone = models.CharField(max_length=16, default="")
cpf = models.CharField(max_length=14, default="123-456-789-12")
birth_date = models.DateField(null=False, default=datetime.datetime.now)
profession = models.CharField(max_length=30, default="")
education = models.CharField(max_length=15, choices=EDUCATION, default=ESCOMPLETE)
marital_status = models.CharField(max_length=15, choices=STATUS, default=SINGLE)
monthly_income = models.CharField(max_length=5, choices=INCOME, default=UPTO_6_5)
funnel_time = models.PositiveIntegerField(default=20)
score = models.CharField(default=A, choices=SCORE)
notes = models.CharField(max_length=100, default="-")
lead = models.ForeignKey(Lead, on_delete=models.CASCADE, null=True, blank=True, related_name='clients')

def get_absolute_url(self):
return "/clientes"

def __str__(self):
return f"{self.first_name} {self.last_name}"


class Company(models.Model):
client_id = models.ForeignKey(Client, on_delete=models.CASCADE)
company_name = models.CharField(max_length=80)
Expand Down