Skip to content

Commit

Permalink
feat(votepeloclima): Change labels to pt-br
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomario committed Aug 28, 2024
1 parent aa2c295 commit 6aa1aee
Showing 1 changed file with 32 additions and 31 deletions.
63 changes: 32 additions & 31 deletions app/org_eleicoes/votepeloclima/candidature/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@


class Candidature(models.Model):
legal_name = models.CharField(max_length=150)
ballot_name = models.CharField(max_length=100)
birth_date = models.DateField()
email = models.EmailField()
cpf = models.CharField(max_length=30)
number_id = models.PositiveIntegerField()
intended_position = models.CharField(max_length=50, choices=IntendedPosition.choices)
deputy_mayor = models.CharField(max_length=140, blank=True, null=True)
deputy_mayor_political_party = models.CharField(max_length=60, blank=True, null=True)
state = models.CharField(max_length=10)
city = models.CharField(max_length=60)
is_collective_mandate = models.BooleanField(default=False, blank=True)
political_party = models.CharField(max_length=60, choices=PoliticalParty.choices)
video = models.FileField(upload_to="candidatures/videos/", null=True, blank=True)
photo = models.FileField(upload_to="candidatures/photos/", null=True, blank=True)
gender = models.CharField(max_length=30, choices=Gender.choices)
color = models.CharField(max_length=30, choices=Color.choices)
sexuality = models.CharField(max_length=30, null=True, blank=True, choices=Sexuality.choices)
social_media = models.JSONField(blank=True, null=True, default=list)
education = models.CharField(max_length=50, null=True, blank=True, choices=Education.choices)
employment = models.CharField(max_length=50, null=True, blank=True)
short_description = models.TextField()
milestones = models.JSONField(blank=True, null=True, default=list)
proposes = models.JSONField(blank=True)
appointments = models.JSONField(blank=True)
legal_name = models.CharField(max_length=150, verbose_name="Nome")
ballot_name = models.CharField(max_length=100, verbose_name="Nome na Urna")
birth_date = models.DateField(verbose_name="Data de Nascimento")
email = models.EmailField(verbose_name="E-mail")
cpf = models.CharField(max_length=30, verbose_name="CPF")
number_id = models.PositiveIntegerField(verbose_name="Número na Urna")
intended_position = models.CharField(max_length=50, choices=IntendedPosition.choices, verbose_name="Cargo Pretendido")
deputy_mayor = models.CharField(max_length=140, blank=True, null=True, verbose_name="Vice-prefeito")
deputy_mayor_political_party = models.CharField(max_length=60, blank=True, null=True, verbose_name="Partido do Vice-prefeito")
state = models.CharField(max_length=10, verbose_name="Estado")
city = models.CharField(max_length=60, verbose_name="Cidade")
is_collective_mandate = models.BooleanField(default=False, blank=True, verbose_name="Mandato Coletivo")
political_party = models.CharField(max_length=60, choices=PoliticalParty.choices, verbose_name="Partido Político")
video = models.FileField(upload_to="candidatures/videos/", null=True, blank=True, verbose_name="Vídeo")
photo = models.FileField(upload_to="candidatures/photos/", null=True, blank=True, verbose_name="Foto")
gender = models.CharField(max_length=30, choices=Gender.choices, verbose_name="Gênero")
color = models.CharField(max_length=30, choices=Color.choices, verbose_name="Raça")
sexuality = models.CharField(max_length=30, null=True, blank=True, choices=Sexuality.choices, verbose_name="Sexualidade")
social_media = models.JSONField(blank=True, null=True, default=list, verbose_name="Redes Sociais")
education = models.CharField(max_length=50, null=True, blank=True, choices=Education.choices, verbose_name="Educação")
employment = models.CharField(max_length=50, null=True, blank=True, verbose_name="Ocupação")
short_description = models.TextField(verbose_name="Descrição Curta")
milestones = models.JSONField(blank=True, null=True, default=list, verbose_name="Marcos")
proposes = models.JSONField(blank=True, verbose_name="Propostas")
appointments = models.JSONField(blank=True, verbose_name="Compromissos")

# friendly url by ballot_name
slug = models.SlugField(max_length=100, unique=True, blank=True, null=True)
Expand Down Expand Up @@ -70,37 +70,38 @@ def save(self, *args, **kwargs):

class CandidatureFlow(models.Model):
# Propriedades só podem ser editadas quando status for `draft`
photo = models.ImageField(upload_to="candidatures/photos/", null=True)
video = models.FileField(upload_to="candidatures/videos/", null=True, blank=True)
photo = models.ImageField(upload_to="candidatures/photos/", null=True, verbose_name="Foto")
video = models.FileField(upload_to="candidatures/videos/", null=True, blank=True, verbose_name="Vídeo")

properties = models.JSONField(blank=True, encoder=DjangoJSONEncoder, default=dict)
properties = models.JSONField(blank=True, encoder=DjangoJSONEncoder, default=dict, verbose_name="Propriedades")
status = models.CharField(
max_length=50,
choices=CandidatureFlowStatus.choices,
default=CandidatureFlowStatus.draft,
verbose_name="Status",
)

# Registro das etapas de validação
# Quem validou? Manual, Bot
# Quando foi validado? Data da ação
# Validado ou não
# Comentário sobre
validations = models.JSONField(blank=True, null=True)
validations = models.JSONField(blank=True, null=True, verbose_name="Validações")

# Etapa 2
# - Preenchimento da Candidatura
# - Envio da Candidatura para avaliação
# - Validadores automatizados
# - Validatores manuais
candidature = models.OneToOneField(
Candidature, null=True, on_delete=models.SET_NULL
Candidature, null=True, blank=True, on_delete=models.SET_NULL, verbose_name="Candidatura"
)

# Etapa 1
# - Criar usuário desabilitado `is_active=False`
# - Enviar e-mail para validar o usuário e criar uma senha de acesso
# - Habilitar usuário `is_active=True`
user = models.OneToOneField(User, null=True, on_delete=models.SET_NULL)
user = models.OneToOneField(User, null=True, on_delete=models.SET_NULL, verbose_name="Usuário")

class Meta:
verbose_name = "Formulário"
Expand Down

0 comments on commit 6aa1aee

Please sign in to comment.