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

Switch Project.tags to django-taggit #94

Open
wants to merge 4 commits into
base: main
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
1 change: 1 addition & 0 deletions hacktj_live/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"dbbackup", # django-dbbackup
"debug_toolbar",
"captcha",
"taggit",
"allauth",
"allauth.account",
"allauth.socialaccount",
Expand Down
29 changes: 29 additions & 0 deletions judge/migrations/0008_remove_project_tags_project_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 4.0 on 2021-12-18 19:28

from django.db import migrations
import taggit.managers


class Migration(migrations.Migration):

dependencies = [
("taggit", "0003_taggeditem_add_unique_index"),
("judge", "0007_alter_annotator_current_alter_annotator_ignore_and_more"),
]

operations = [
migrations.RemoveField(
model_name="project",
name="tags",
),
migrations.AddField(
model_name="project",
name="tags",
field=taggit.managers.TaggableManager(
help_text="A comma-separated list of tags.",
through="taggit.TaggedItem",
to="taggit.Tag",
verbose_name="Tags",
),
),
]
4 changes: 2 additions & 2 deletions judge/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from django.db import models
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from taggit.managers import TaggableManager
from django.utils.translation import gettext_lazy

num_criteria = len(settings.LIVE_JUDGE_CRITERIA)
Expand All @@ -11,7 +11,7 @@ class Project(models.Model):
name = models.CharField(max_length=255)
location = models.CharField(max_length=255)
description = models.CharField(max_length=255)
tags = ArrayField(models.CharField(max_length=255), default=list)
tags = TaggableManager()
link = models.URLField(blank=True)

overall_mean = models.DecimalField(default=0.0, decimal_places=8, max_digits=12)
Expand Down
17 changes: 16 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dealer = "^2.1.0"
prettytable = "^2.0.0"
django-sendgrid-v5 = "^1.1.1"
pymemcache = "^3.4.1"
django-taggit = "^2.0.0"

[tool.poetry.dev-dependencies]
black = "^21.12b0"
Expand Down