# HG changeset patch # User cavaliet # Date 1390924619 -3600 # Node ID 438b80fe3d7b8a2e2dfab2912e54356f5ddac3b3 # Parent b5d6eff78369f5e63b3bbf7a4ada27248926da66 v0.60 : little debugs and minor changes diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/__init__.py --- a/src/jocondelab/__init__.py Tue Jan 28 13:51:16 2014 +0100 +++ b/src/jocondelab/__init__.py Tue Jan 28 16:56:59 2014 +0100 @@ -1,4 +1,4 @@ -VERSION = (0, 59, 0, "final", 0) +VERSION = (0, 60, 0, "final", 0) def get_version(): diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/locale/en/LC_MESSAGES/django.mo Binary file src/jocondelab/locale/en/LC_MESSAGES/django.mo has changed diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/locale/en/LC_MESSAGES/django.po --- a/src/jocondelab/locale/en/LC_MESSAGES/django.po Tue Jan 28 13:51:16 2014 +0100 +++ b/src/jocondelab/locale/en/LC_MESSAGES/django.po Tue Jan 28 16:56:59 2014 +0100 @@ -793,7 +793,7 @@ #: templates/jocondelab/front_notice.html:44 #: templates/jocondelab/partial/notice_list.html:14 msgid "Artiste(s) :" -msgstr "Artit(s):" +msgstr "Artist(s):" #: templates/jocondelab/front_notice.html:50 msgid "École :" diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/locale/fr/LC_MESSAGES/django.mo Binary file src/jocondelab/locale/fr/LC_MESSAGES/django.mo has changed diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/locale/fr/LC_MESSAGES/django.po --- a/src/jocondelab/locale/fr/LC_MESSAGES/django.po Tue Jan 28 13:51:16 2014 +0100 +++ b/src/jocondelab/locale/fr/LC_MESSAGES/django.po Tue Jan 28 16:56:59 2014 +0100 @@ -583,6 +583,160 @@ " \n" " " msgstr "" +"\n" +"
\n" +"

Le site JocondeLab est une publication du ministère de la Culture " +"et de la Communication.

\n" +"
\n" +" \n" +"
\n" +"

Équipe responsable du site Joconde

\n" +"

Direction générale des patrimoines – Service des musées de " +"France - Sous-direction des collections - Bureau de la diffusion numérique " +"des collections

\n" +" \n" +"
\n" +" \n" +"
\n" +"

Pilotage du projet

\n" +"

Délégation générale à la langue française et aux langues de " +"France – Mission des langues et du numérique

\n" +" \n" +"

Secrétariat général - Sous-direction des systèmes d'information\n" +" \n" +"

\n" +" \n" +"
\n" +"

Expertise

\n" +"

Département des programmes numériques

\n" +" \n" +"
\n" +" \n" +"
\n" +"

Conception et réalisation du site

\n" +"

Institut de recherche et d'innovation

\n" +"

www.iri." +"centrepompidou.fr

\n" +" \n" +"
\n" +" \n" +"
\n" +"

Traduction de l'interface

\n" +" \n" +"
\n" +" \n" +"
\n" +"

Partenariat

\n" +"

Gobelins l’École de l'image

\n" +"

www.gobelins.fr

\n" +" \n" +"
\n" +" \n" +"
\n" +"

Merci aux contributeurs Wikipédia et aux équipes qui ont développé DBpedia.org et DBpedia.fr

\n" +"

 

\n" +"

Le site JocondeLab est présenté dans une version bêta.

\n" +"

© Ministère de la Culture et de la Communication – 2013

\n" +"
\n" +" " #: templates/jocondelab/front_describe.html:12 msgid "Décrivez le sujet de cette œuvre" diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/views/ajax.py --- a/src/jocondelab/views/ajax.py Tue Jan 28 13:51:16 2014 +0100 +++ b/src/jocondelab/views/ajax.py Tue Jan 28 16:56:59 2014 +0100 @@ -126,8 +126,12 @@ def render_contribution(self, contribution, request): lang = request.LANGUAGE_CODE[:2] + try: + label = contribution.term.dbpedia_fields.get(language_code=lang).label + except: + return HttpResponseBadRequest("Label not available") termdict = { - "label": contribution.term.dbpedia_fields.get(language_code=lang).label, + "label": label, "dbpedia_uri": contribution.term.dbpedia_uri, "contribution_id": contribution.id, "li_style": "positive" if contribution.contribution_count > 0 else "null", diff -r b5d6eff78369 -r 438b80fe3d7b src/jocondelab/views/front_office.py --- a/src/jocondelab/views/front_office.py Tue Jan 28 13:51:16 2014 +0100 +++ b/src/jocondelab/views/front_office.py Tue Jan 28 16:56:59 2014 +0100 @@ -129,12 +129,12 @@ else: if dbpedia_uris: queryobj = {'dbpedia_uri': dbpedia_uri} - fs = list(DbpediaFields.objects.filter(dbpedia_uri__in=dbpedia_uris, language_code=lang)) + fs = list(DbpediaFields.objects.filter(dbpedia_uri__in=dbpedia_uris, language_code=lang).exclude(label__isnull=True)) searchterms = set([fields.label for fields in fs]) elif queryterms: searchterms = queryterms queryobj = {'q': querystr} - fs = list(DbpediaFields.objects.filter(label__in=queryterms, language_code=lang)) + fs = list(DbpediaFields.objects.filter(label__in=queryterms, language_code=lang).exclude(label__isnull=True)) # If fs is empty, qs has to be empty if len(fs)==0: qs = qs.none() @@ -178,8 +178,7 @@ else: paginator = JocondeFrontPaginator(qs.values_list('id', flat=True).order_by('id').distinct(), npp, count_qs) context["page_count"] = paginator.num_pages - logger.debug("PAGE COUNT = ") - logger.debug(context["page_count"]) + ids = paginator.page(min(int(page),paginator.num_pages)) if paginator.count: count_log = math.log10(paginator.count) @@ -191,8 +190,7 @@ context["count"] = paginator.count - (paginator.count % 10**(int(count_log)-1) ) else: context["count"] = paginator.count - logger.debug("COUNT = ") - logger.debug(context["count"]) + # Now that we have the list of ids ns = Notice.objects.filter(pk__in=ids).extra(select={'relative_url': '"core_noticeimage"."relative_url"'}).filter(image=True).filter(images__main=True).order_by('id') # We check if we are in the last page of the "real" notices and not the +/- number of notices.