KeywordRetriever/retriever/components/paragraph_render.py

21 lines
569 B
Python

from django.utils.timezone import now
from django_unicorn.components import UnicornView
from retriever.models import RetrieverTask
class ParagraphRenderView(UnicornView):
current_task = None
def mount(self):
print(self.component_args)
self.arg = self.component_args[0]
# self.current_task = RetrieverTask.objects.get(task_uuid=arg)
def get_paragraphs(self):
self.current_task = RetrieverTask.objects.get(task_uuid=self.arg)
print(self.current_task)
return RetrieverTask.objects.get(task_uuid=self.arg)