From 7999e14da3190d9f44e70a5dfbe1b2cedf55a5df Mon Sep 17 00:00:00 2001 From: Magnus Granberg Date: Tue, 22 Nov 2016 23:05:38 +0100 Subject: Update for django 1.10 and fix links for css and js --- python/gentoo_main/urls.py | 3 ++- python/tbc_www/models.py | 2 +- python/tbc_www/router.py | 4 ++-- python/tbc_www/urls.py | 25 +++++++++++++------------ python/templates/includes/layout/head.html | 6 +++--- python/templates/includes/layout/header.html | 6 +++--- python/templates/layout/base.html | 4 ++-- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/python/gentoo_main/urls.py b/python/gentoo_main/urls.py index 1eb5179..ff710c4 100644 --- a/python/gentoo_main/urls.py +++ b/python/gentoo_main/urls.py @@ -1,7 +1,8 @@ # Copyright 1998-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -from django.conf.urls import patterns, include, url +from django.conf.urls import url +from . import views urlpatterns = [ url(r'^home/$', views.home), diff --git a/python/tbc_www/models.py b/python/tbc_www/models.py index 0d58bc1..a0a25f3 100644 --- a/python/tbc_www/models.py +++ b/python/tbc_www/models.py @@ -74,7 +74,7 @@ class EbuildsMetadata(models.Model): class Meta: db_table = 'ebuilds_metadata' def __str__(self): - return '%s %s %s %s %s' % (self.Id, self.EbuildId, self,Commit, self.New, self.Descriptions) + return '%s %s %s %s %s' % (self.Id, self.EbuildId, self.Commit, self.New, self.Descriptions) class BuildLogs(models.Model): BuildLogId = models.IntegerField(primary_key=True, db_column='build_log_id') diff --git a/python/tbc_www/router.py b/python/tbc_www/router.py index 7a512fd..bac2a30 100644 --- a/python/tbc_www/router.py +++ b/python/tbc_www/router.py @@ -23,8 +23,8 @@ class TBCRouter(object): return True return False - def allow_migrate(self, db, model): - if db == 'tbc' or model._meta.app_label == "tbc_www": + def allow_migrate(self, db, app_label, model_name=None, **hints): + if db == 'tbc' or app_label == "tbc_www": return False # we're not using syncdb on our legacy database else: # but all other models/databases are fine return True diff --git a/python/tbc_www/urls.py b/python/tbc_www/urls.py index 5be267f..ea2db31 100644 --- a/python/tbc_www/urls.py +++ b/python/tbc_www/urls.py @@ -1,13 +1,14 @@ -from django.conf.urls import patterns, include, url +from django.conf.urls import url +from . import views -urlpatterns = patterns('tbc_www.views', - url(r'^home/$', 'home'), - url(r'^packages/$', 'categories'), - url(r'^categories/(?P\d+)/$', 'packages'), - url(r'^packages/(?P\d+)/$', 'ebuilds'), - url(r'^ebuild/(?P\d+)/$', 'ebuild'), - url(r'^new/logs/build/(?P\d+)/$', 'new_logs_build'), - url(r'^new/logs/$', 'new_logs'), - url(r'^new/repoman/$', 'new_repoman'), - url(r'^new/$', 'new_main'), -) +urlpatterns = [ + url(r'^home/$', views.home), + url(r'^packages/$', views.categories), + url(r'^categories/(?P\d+)/$', views.packages), + url(r'^packages/(?P\d+)/$', views.ebuilds), + url(r'^ebuild/(?P\d+)/$', views.ebuild), + url(r'^new/logs/build/(?P\d+)/$', views.new_logs_build), + url(r'^new/logs/$', views.new_logs), + url(r'^new/repoman/$', views.new_repoman), + url(r'^new/$', views.new_main), +] diff --git a/python/templates/includes/layout/head.html b/python/templates/includes/layout/head.html index d8ed708..22bfa58 100644 --- a/python/templates/includes/layout/head.html +++ b/python/templates/includes/layout/head.html @@ -11,8 +11,8 @@ - - + + {% if page.extracss %}{% for css in page.extracss %}{% endfor %}{% endif %} @@ -22,4 +22,4 @@ {% if page.meta %}{{ page.meta|safe|escape }}{% endif %} - \ No newline at end of file + diff --git a/python/templates/includes/layout/header.html b/python/templates/includes/layout/header.html index 8b6bc63..585ea59 100644 --- a/python/templates/includes/layout/header.html +++ b/python/templates/includes/layout/header.html @@ -28,8 +28,8 @@