aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'servo/models/common.py')
-rw-r--r--servo/models/common.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/servo/models/common.py b/servo/models/common.py
index 69feea2..520b769 100644
--- a/servo/models/common.py
+++ b/servo/models/common.py
@@ -762,9 +762,9 @@ class Template(models.Model):
class Attachment(models.Model):
"""A file attached to something."""
-
- ref = models.CharField(max_length=32)
- ref_id = models.IntegerField()
+ content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
+ object_id = models.PositiveIntegerField()
+ content_object = GenericForeignKey('content_type', 'object_id')
mime_type = models.CharField(max_length=64, editable=False)
content = models.FileField(