diff options
author | luxagraf <sng@luxagraf.net> | 2020-11-15 16:08:22 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-11-15 16:08:22 -0500 |
commit | 18b2fbfb06d0848b51b047a10cf10839853c3cf9 (patch) | |
tree | 97f18b8993ef7083e8676019811615d0b1c2f1a5 /app | |
parent | d2094ea9bb2179011de1adb39b343cd9492c5506 (diff) |
added site build var to pages app
Diffstat (limited to 'app')
-rw-r--r-- | app/builder/base.py | 5 | ||||
-rw-r--r-- | app/builder/views.py | 2 | ||||
-rw-r--r-- | app/pages/build.py | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/app/builder/base.py b/app/builder/base.py index fabea6e..04a92ce 100644 --- a/app/builder/base.py +++ b/app/builder/base.py @@ -1,6 +1,7 @@ import os from math import ceil from decimal import Decimal +from django.contrib.sites.models import Site from django.test.client import Client from django.template.loader import render_to_string from django.template import Context @@ -33,7 +34,9 @@ class _FileWriter(object): class BuildNew(): - def __init__(self, model, app): + + def __init__(self, model, app, site=1): + self.site = Site.objects.get(domain=site) self.model = apps.get_model(model, app) self.get_model_queryset() self.client = Client() diff --git a/app/builder/views.py b/app/builder/views.py index 97ca30a..7804630 100644 --- a/app/builder/views.py +++ b/app/builder/views.py @@ -37,7 +37,7 @@ def do_build(request): BuildGuide("posts", "post").build() elif section == 'pages': context = {'message': 'Writing Pages to Disk'} - BuildPages("pages", "page").build() + BuildPages("pages", "page", 'luxagraf.net').build() elif section == 'fieldnotes': context = {'message': 'Writing FieldNotes to Disk'} BuildFieldNotes("posts", "post").build() diff --git a/app/pages/build.py b/app/pages/build.py index fa380c1..a0186a7 100644 --- a/app/pages/build.py +++ b/app/pages/build.py @@ -13,7 +13,7 @@ class BuildPages(BuildNew): print("building pages") def get_model_queryset(self): - return self.model.objects.filter(build=True) + return self.model.objects.filter(build=True,site=self.site) class BuildHome(BuildNew): |