diff --git a/boards/migrations/0003_remove_tag_threads.py b/boards/migrations/0003_remove_tag_threads.py new file mode 100644 --- /dev/null +++ b/boards/migrations/0003_remove_tag_threads.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('boards', '0002_auto_20141118_2234'), + ] + + operations = [ + migrations.RemoveField( + model_name='tag', + name='threads', + ), + ] diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -268,18 +268,6 @@ class Post(models.Model, Viewable): thread.last_edit_time = edit_time thread.save(update_fields=['last_edit_time']) - @transaction.atomic - def remove_tag(self, tag): - edit_time = timezone.now() - - thread = self.get_thread() - thread.remove_tag(tag) - self.last_edit_time = edit_time - self.save(update_fields=['last_edit_time']) - - thread.last_edit_time = edit_time - thread.save(update_fields=['last_edit_time']) - def get_url(self, thread=None): """ Gets full url to the post. diff --git a/boards/models/tag.py b/boards/models/tag.py --- a/boards/models/tag.py +++ b/boards/models/tag.py @@ -36,8 +36,6 @@ class Tag(models.Model, Viewable): ordering = ('name',) name = models.CharField(max_length=100, db_index=True) - threads = models.ManyToManyField(Thread, null=True, - blank=True, related_name='tag+') def __str__(self): return self.name diff --git a/boards/models/thread.py b/boards/models/thread.py --- a/boards/models/thread.py +++ b/boards/models/thread.py @@ -136,7 +136,6 @@ class Thread(models.Model): """ self.tags.add(tag) - tag.threads.add(self) def get_opening_post(self, only_id=False): """