From e5195da141f9a346e83b5ce2f87489eb3f1bf3fd Mon Sep 17 00:00:00 2001 From: j Date: Fri, 22 Oct 2021 17:15:06 +0100 Subject: [PATCH] also include related --- app/video/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/video/models.py b/app/video/models.py index 3b30a8a..644deac 100644 --- a/app/video/models.py +++ b/app/video/models.py @@ -4,6 +4,7 @@ import json from django.conf import settings from django.contrib.auth import get_user_model from django.db import models +from django.db.models import Q import ox @@ -32,7 +33,7 @@ class Film(models.Model): def related_texts(self): from ..text.models import Text - return Text.objects.filter(data__item=self.padma_id) + return Text.objects.filter(Q(data__item=self.padma_id) | Q(data__related=self.padma_id)) def duration(self): return ox.format_duration(self.data['duration'] * 1000, verbosity=1, milliseconds=False)