Skip to content
Snippets Groups Projects
Commit f9338cf6 authored by Mark Skipper's avatar Mark Skipper
Browse files

Add 'items' as reverse relatiob from Term to Item

This was defaulting to message_set, and we're still thinking we might
rename Message to Item at some point
parent a598a48b
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('data_layer', '0003_message_terms'),
]
operations = [
migrations.AlterField(
model_name='message',
name='terms',
field=models.ManyToManyField(related_name='items', to='taxonomies.Term'),
),
]
......@@ -12,7 +12,7 @@ class DataLayerModel(models.Model):
class Message(DataLayerModel):
body = models.TextField()
timestamp = models.DateTimeField(null=True)
terms = models.ManyToManyField(Term)
terms = models.ManyToManyField(Term, related_name="items")
def apply_term(self, term):
# TODO: test this
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment