Skip to content

Commit

Permalink
Merge pull request #234 from nossas/hotfix/remove-postgresql-dependen…
Browse files Browse the repository at this point in the history
…ce-from-model

Fix: Changed arrayfields to json fields on candidature model
  • Loading branch information
igr-santos authored Jul 26, 2024
2 parents b41e004 + 56aae94 commit 277deba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Generated by Django 4.2 on 2024-07-22 21:30
# Generated by Django 4.2 on 2024-07-23 19:13

import django.contrib.postgres.fields
from django.db import migrations, models


Expand All @@ -22,11 +21,11 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='candidature',
name='milestones',
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=140), blank=True, null=True, size=5),
field=models.JSONField(blank=True, default=list, null=True),
),
migrations.AddField(
model_name='candidature',
name='social_media',
field=django.contrib.postgres.fields.ArrayField(base_field=models.URLField(blank=True), blank=True, null=True, size=5),
field=models.JSONField(blank=True, default=list, null=True),
),
]
5 changes: 2 additions & 3 deletions app/org_eleicoes/votepeloclima/candidature/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.db import models
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.core.serializers.json import DjangoJSONEncoder


Expand Down Expand Up @@ -29,12 +28,12 @@ class Candidature(models.Model):
gender = models.CharField(max_length=30)
color = models.CharField(max_length=30)
sexuality = models.CharField(max_length=30, null=True, blank=True)
social_media = ArrayField(models.URLField(blank=True), size=5, null=True, blank=True)
social_media = models.JSONField(blank=True, null=True, default=list)
# Step 4
education = models.CharField(max_length=50, null=True, blank=True)
employment = models.CharField(max_length=50, null=True, blank=True)
short_description = models.TextField()
milestones = ArrayField(models.CharField(max_length=140, blank=True), size=5, null=True, blank=True)
milestones = models.JSONField(blank=True, null=True, default=list)
# Step 5
flags = models.JSONField(blank=True)
# Step 6
Expand Down

0 comments on commit 277deba

Please sign in to comment.