equal
deleted
inserted
replaced
396 |
396 |
397 if lang not in no_translate_langs: |
397 if lang not in no_translate_langs: |
398 transqs = DbpediaFieldsTranslation.objects.filter(master__in = dbpediafields.values(), language_code = lang) |
398 transqs = DbpediaFieldsTranslation.objects.filter(master__in = dbpediafields.values(), language_code = lang) |
399 translations = dict([(trans.master_id,trans.label) for trans in transqs]) |
399 translations = dict([(trans.master_id,trans.label) for trans in transqs]) |
400 |
400 |
401 tags = [{'id': tag.id, 'label': tag.label, 'score': tag.nb, 'translated_label': translations.get(dbpediafields[tag.id].id, tag.label) if tag.id in dbpediafields else tag.label} for tag in tagqslist] |
401 tags = [{'id': tag.id, 'label': tag.label, 'score': tag.nb, 'thumbnail': dbpediafields[tag.id].thumbnail, 'translated_label': translations.get(dbpediafields[tag.id].id, tag.label) if tag.id in dbpediafields else tag.label} for tag in tagqslist] |
402 |
402 |
403 countryqs = countryqs.annotate(nb=Count('includes__tag__taggedsheet')) |
403 countryqs = countryqs.annotate(nb=Count('includes__tag__taggedsheet')) |
404 countries = dict([(country.dbpedia_uri, country.nb) for country in countryqs]) |
404 countries = dict([(country.dbpedia_uri, country.nb) for country in countryqs]) |
405 |
405 |
406 discqslist = list(discqs.annotate(nb=Count('taggedsheet')).order_by('-nb')[:10]) |
406 discqslist = list(discqs.annotate(nb=Count('taggedsheet')).order_by('-nb')[:10]) |