diff options
Diffstat (limited to 'servo/models')
-rw-r--r-- | servo/models/common.py | 6 |
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( |