Skip to content

Commit

Permalink
Changed tags to use description rather than colour.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurora0000 committed Jun 24, 2015
1 parent beae95e commit c0fe215
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
23 changes: 23 additions & 0 deletions forums/migrations/0025_auto_20150624_1924.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('forums', '0024_post_is_locked'),
]

operations = [
migrations.RemoveField(
model_name='tag',
name='colour',
),
migrations.AddField(
model_name='tag',
name='description',
field=models.TextField(null=True, blank=True),
),
]
3 changes: 1 addition & 2 deletions forums/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

class Tag(models.Model):
name = models.CharField(max_length=40)
# Hex colours will be converted to an integer here for convenience
colour = models.IntegerField()
description = models.TextField(blank=True, null=True)

def __str__(self):
return self.name
Expand Down
2 changes: 1 addition & 1 deletion forums/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Meta:
class TagForTopicSerializer(serializers.ModelSerializer):
class Meta:
model = Tag
fields = ('name', 'colour')
fields = ('name', 'description')

class PostSerializer(serializers.ModelSerializer):
author_name = serializers.SerializerMethodField()
Expand Down

0 comments on commit c0fe215

Please sign in to comment.