diff --git a/boards/migrations/0070_auto_20171225_1149.py b/boards/migrations/0070_auto_20171225_1149.py new file mode 100644 --- /dev/null +++ b/boards/migrations/0070_auto_20171225_1149.py @@ -0,0 +1,23 @@ +# Generated by Django 2.0 on 2017-12-25 09:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('boards', '0069_usersettings'), + ] + + operations = [ + migrations.AlterField( + model_name='post', + name='attachments', + field=models.ManyToManyField(blank=True, related_name='attachment_posts', to='boards.Attachment'), + ), + migrations.AlterField( + model_name='post', + name='referenced_posts', + field=models.ManyToManyField(blank=True, db_index=True, related_name='refposts', to='boards.Post'), + ), + ] diff --git a/boards/models/post/__init__.py b/boards/models/post/__init__.py --- a/boards/models/post/__init__.py +++ b/boards/models/post/__init__.py @@ -77,7 +77,7 @@ class Post(models.Model, Viewable): text = TextField(blank=True, default='') _text_rendered = TextField(blank=True, null=True, editable=False) - attachments = models.ManyToManyField(Attachment, null=True, blank=True, + attachments = models.ManyToManyField(Attachment, blank=True, related_name='attachment_posts') poster_ip = models.GenericIPAddressField() @@ -86,7 +86,6 @@ class Post(models.Model, Viewable): last_edit_time = models.DateTimeField() referenced_posts = models.ManyToManyField('Post', symmetrical=False, - null=True, blank=True, related_name='refposts', db_index=True) refmap = models.TextField(null=True, blank=True)