From: Guillaume Pellerin Date: Fri, 23 Sep 2016 08:38:51 +0000 (+0200) Subject: Fix data pull, ad sub_topic filter X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3db00c2a81d0d80fe6f0348662eb65bc43711671;p=mezzo.git Fix data pull, ad sub_topic filter --- diff --git a/app/organization/core/templatetags/organization_tags.py b/app/organization/core/templatetags/organization_tags.py index df978b3d..1000ea1a 100644 --- a/app/organization/core/templatetags/organization_tags.py +++ b/app/organization/core/templatetags/organization_tags.py @@ -8,6 +8,7 @@ from random import shuffle from organization.festival.models import * from organization.magazine.models import * +from organization.projects.models import * register = Library() @@ -107,3 +108,7 @@ def get_type_link(objects, name): @register.filter def in_category(objects, category): return objects.filter(category=type) + +@register.filter +def sub_topics(topic): + return Topic.objects.filter(parent=topic) diff --git a/app/organization/projects/views.py b/app/organization/projects/views.py index 717b457e..a1e7c310 100644 --- a/app/organization/projects/views.py +++ b/app/organization/projects/views.py @@ -4,12 +4,6 @@ from organization.projects.models import * from organization.core.views import * -class ProjectListView(ListView): - - model = Project - template_name='projects/project_list.html' - - class ProjectDetailView(SlugMixin, DetailView): model = Project diff --git a/app/templates/pages/projectopicpage.html b/app/templates/pages/projectopicpage.html index 3a47e02a..ff57699d 100644 --- a/app/templates/pages/projectopicpage.html +++ b/app/templates/pages/projectopicpage.html @@ -44,7 +44,7 @@ {% endif %} {% with page.projecttopicpage.project_topic as topic %} - {% for sub_topic in topic.topics.all %} + {% for sub_topic in topic|sub_topics %} {{ sub_topic }} {% trans "European and national projects" %}
{% for project in sub_topic.projects.all|get_type:"external project" %} diff --git a/scripts/pull.sh b/scripts/pull.sh index f5e3f395..bdb5aa00 100755 --- a/scripts/pull.sh +++ b/scripts/pull.sh @@ -4,4 +4,5 @@ sudo chown -R $USER data/media sudo chown -R $USER data/backup git pull git submodule update --init --recursive +git submodule foreach git pull origin master docker-compose run db /srv/scripts/restore_db.sh diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index a60d1138..d3197a3d 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -4,6 +4,7 @@ git pull origin dev git submodule update --init --recursive +git submodule foreach git pull origin master docker-compose run app python /srv/app/manage.py migrate --noinput bower install gulp build