Commit ffff2fd6 authored by Administrator's avatar Administrator

[FEAT] no link for Graph page if Workflow not finished yet.

parent bd4666e6
......@@ -495,12 +495,18 @@ def corpus(request, project_id, corpus_id):
print(chart)
except Exception as error:
print(error)
try:
processing = corpus.metadata['Processing']
except:
processing = 0
html = t.render(Context({\
'user': user,\
'date': date,\
'project': project,\
'corpus' : corpus,\
'processing' : processing,\
# 'documents': documents,\
'number' : number,\
'dates' : chart,\
......
......@@ -237,12 +237,16 @@ class Node(CTENode):
@current_app.task(filter=task_method)
def workflow(self, keys=None, ngramsextractorscache=None, ngramscaches=None, verbose=False):
print("In workflow() START")
self.metadata['Processing'] = 1
self.save()
self.parse_resources()
type_document = NodeType.objects.get(name='Document')
self.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
from analysis.functions import do_tfidf
do_tfidf(self)
print("In workflow() END")
self.metadata['Processing'] = 0
self.save()
class Node_Metadata(models.Model):
node = models.ForeignKey(Node, on_delete=models.CASCADE)
......
......@@ -131,7 +131,11 @@
<div class="col-md-4">
<div class="jumbotron">
<h3><a href="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer">Graph</a></h3>
{% if processing == "0" %}
<h3><a href="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer">Graph</a></h3>
{% else %}
<h3> <img width="20px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img> Graph (later)</h3>
{% endif %}
<ol>
<li>Visualize</li>
<li>Explore</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment