diff options
Diffstat (limited to 'app/pages/build.py')
-rw-r--r-- | app/pages/build.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/pages/build.py b/app/pages/build.py new file mode 100644 index 0000000..94719a2 --- /dev/null +++ b/app/pages/build.py @@ -0,0 +1,27 @@ +from django.template.loader import render_to_string +from django.template import Context +from django.core.urlresolvers import reverse +from django.conf import settings + +from builder.base import BuildNew + + +class BuildPages(BuildNew): + def build(self): + self.build_detail_view() + self.build_essays() + print("building pages") + + def build_essays(self): + qs = self.model.objects.filter(path="essays") + c = Context({'object_list': qs, 'MEDIA_URL': settings.BAKED_MEDIA_URL, 'IMAGES_URL': settings.BAKED_IMAGES_URL}) + t = render_to_string('archives/essays.html', c).encode('utf-8') + self.write_file('essays/', t) + + def get_model_queryset(self): + return self.model.objects.all() + + +def builder(): + j = BuildPages("pages", "Page") + j.build() |