summaryrefslogtreecommitdiff
path: root/app/people/build.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-03-07 10:31:15 -0600
committerluxagraf <sng@luxagraf.net>2018-03-07 10:31:15 -0600
commitce9c1a25a2872979b969c64f804529d200a8c0ad (patch)
tree809ba96e13ff51c45d8d9f46e6700b1fe4f82b09 /app/people/build.py
parent875e1a8c87ea0825653684068810987c78c94857 (diff)
added a people app as per derek sivers' suggestion
Diffstat (limited to 'app/people/build.py')
-rw-r--r--app/people/build.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/people/build.py b/app/people/build.py
new file mode 100644
index 0000000..35fdb19
--- /dev/null
+++ b/app/people/build.py
@@ -0,0 +1,35 @@
+import os
+from django.urls import reverse
+from builder.base import BuildNew
+
+
+class BuildBooks(BuildNew):
+
+ def build(self):
+ self.build_detail_view()
+ self.build_list_view(
+ base_path=reverse("books:live_redirect"),
+ paginate_by=24
+ )
+ print("building books")
+
+ def get_model_queryset(self):
+ return self.model.objects.all()
+
+ def build_detail_view(self):
+ '''
+ write out all the expenses for each trip
+ '''
+ for obj in self.get_model_queryset():
+ url = obj.get_absolute_url()
+ path, slug = os.path.split(url)
+ path = '%s/' % path
+ # write html
+ response = self.client.get(url)
+ print(path, slug)
+ self.write_file(path, response.content, filename=slug)
+
+
+def builder():
+ j = BuildBooks("books", "book")
+ j.build()