Commit ffd4c97e authored by Administrator's avatar Administrator

[FEATURE] link to document + extract terms.

parent a09432b4
...@@ -141,6 +141,7 @@ def project(request, project_id): ...@@ -141,6 +141,7 @@ def project(request, project_id):
date = datetime.datetime.now() date = datetime.datetime.now()
type_corpus = NodeType.objects.get(name='Corpus') type_corpus = NodeType.objects.get(name='Corpus')
type_document = NodeType.objects.get(name='Document')
type_whitelist = NodeType.objects.get(name='WhiteList') type_whitelist = NodeType.objects.get(name='WhiteList')
type_blacklist = NodeType.objects.get(name='BlackList') type_blacklist = NodeType.objects.get(name='BlackList')
type_cooclist = NodeType.objects.get(name='Cooccurrence') type_cooclist = NodeType.objects.get(name='Cooccurrence')
...@@ -240,6 +241,10 @@ def project(request, project_id): ...@@ -240,6 +241,10 @@ def project(request, project_id):
try: try:
#corpus.parse_resources.apply_async((), countdown=1) #corpus.parse_resources.apply_async((), countdown=1)
corpus.parse_resources() corpus.parse_resources()
# async
corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
except Exception as error: except Exception as error:
print(error) print(error)
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
{% if documents %} {% if documents %}
<ul> <ul>
{% for doc in documents %} {% for doc in documents %}
<li> <b>{{ doc.date }}</b>, <a href="#">{{ doc.title}}</a></li> <li> <b>{{ doc.date }}</b>, <a href="/admin/node/document/{{doc.id}}">{{ doc.title}}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
......
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