Commit fe1902be authored by delanoe's avatar delanoe

Merge branch 'refactoring' into refactoring-alex

parents 7122addb ab9b6c18
......@@ -16,7 +16,6 @@ class Ngram(Base):
class NodeNgram(Base):
__tablename__ = 'nodes_ngrams'
id = Column(Integer)
node_id = Column(Integer, ForeignKey(Node.id, ondelete='CASCADE'), primary_key=True)
ngram_id = Column(Integer, ForeignKey(Ngram.id, ondelete='CASCADE'), primary_key=True)
weight = Column(Float)
......@@ -102,6 +102,7 @@ def project(request, project_id):
sourcename2corpora = defaultdict(list)
for corpus in corpora:
# we only consider the first resource of the corpus to determine its type
corpus.count = corpus.children('DOCUMENT').count()
resource = corpus.resources()[0]
resource_type = RESOURCETYPES[resource['type']]
sourcename2corpora[resource_type['name']].append(corpus)
......
......@@ -81,7 +81,7 @@
<img width="20px" src="{% static "js/libs/img2/loading-bar.gif" %}">
Processing, drink a cup of tea, and refresh the page :)
{% else %}
<a href="/projects/{{project.id}}/corpora/{{corpus.id}}"> {{corpus.name}} , {{ corpus.count }} Documents </a>
<a href="/projects/{{project.id}}/corpora/{{corpus.id}}"> {{corpus.name}} , {{ corpus.count }} documents</a>
{% endifequal %}
<button type="button" class="btn btn-xs btn-default" data-container="body" data-toggle="popover" data-placement="bottom"
data-content='
......
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