From d2ca08edbef7e08afbeb18a1dd8e6cabe1f16a3f Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Sat, 15 May 2021 15:15:21 +0300 Subject: Fix saving notes --- servo/models/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'servo/models/common.py') 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( -- cgit v1.2.3