summaryrefslogtreecommitdiff
path: root/app/resume
diff options
context:
space:
mode:
Diffstat (limited to 'app/resume')
-rw-r--r--app/resume/build.py21
-rw-r--r--app/resume/migrations/0001_initial.py49
-rw-r--r--app/resume/migrations/0002_auto_20151207_2105.py25
-rw-r--r--app/resume/migrations/__init__.py0
-rw-r--r--app/resume/models.py5
-rw-r--r--app/resume/urls.py2
6 files changed, 96 insertions, 6 deletions
diff --git a/app/resume/build.py b/app/resume/build.py
index 2b472a4..9d6ad60 100644
--- a/app/resume/build.py
+++ b/app/resume/build.py
@@ -1,6 +1,7 @@
import os
from django.core.urlresolvers import reverse
from builder.base import BuildNew
+from pages.models import Page
class BuildResume(BuildNew):
@@ -8,17 +9,14 @@ class BuildResume(BuildNew):
def build(self):
self.build_detail_view()
self.build_list_view(
- base_path=reverse("resume:list"),
- paginate_by=99999
+ base_path=reverse("resume:live_redirect"),
+ paginate_by=8
)
def get_model_queryset(self):
return self.model.objects.all()
def build_detail_view(self):
- '''
- write out my backups of published articles
- '''
for obj in self.get_model_queryset():
url = obj.get_absolute_url()
path, slug = os.path.split(url)
@@ -28,6 +26,19 @@ class BuildResume(BuildNew):
print(path, slug)
self.write_file(path, response.content, filename=slug)
+ def build_pages(self):
+ '''
+ build out /resume and /resume/cv
+ '''
+ pages = Page.objects.filter(app="resume")
+ for obj in pages:
+ 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 = BuildResume("resume", "pubitem")
diff --git a/app/resume/migrations/0001_initial.py b/app/resume/migrations/0001_initial.py
new file mode 100644
index 0000000..14c9348
--- /dev/null
+++ b/app/resume/migrations/0001_initial.py
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9 on 2015-12-07 21:04
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ initial = True
+
+ dependencies = [
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='PubItem',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('title', models.CharField(max_length=200)),
+ ('slug', models.CharField(max_length=50)),
+ ('body_markdown', models.TextField(blank=True, null=True)),
+ ('body_html', models.TextField(blank=True, null=True)),
+ ('url', models.CharField(blank=True, max_length=200, null=True)),
+ ('pub_date', models.DateTimeField(verbose_name='Date published')),
+ ],
+ options={
+ 'ordering': ('-pub_date',),
+ },
+ ),
+ migrations.CreateModel(
+ name='Publisher',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=200)),
+ ('slug', models.SlugField()),
+ ('body_markdown', models.TextField(blank=True, null=True)),
+ ('body_html', models.TextField(blank=True, null=True)),
+ ('url', models.CharField(blank=True, max_length=200, null=True)),
+ ('payment_time', models.DecimalField(decimal_places=0, max_digits=2)),
+ ],
+ ),
+ migrations.AddField(
+ model_name='pubitem',
+ name='publisher',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resume.Publisher'),
+ ),
+ ]
diff --git a/app/resume/migrations/0002_auto_20151207_2105.py b/app/resume/migrations/0002_auto_20151207_2105.py
new file mode 100644
index 0000000..7ac653f
--- /dev/null
+++ b/app/resume/migrations/0002_auto_20151207_2105.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9 on 2015-12-07 21:05
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('resume', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='publisher',
+ options={'ordering': ('-order',)},
+ ),
+ migrations.AddField(
+ model_name='publisher',
+ name='order',
+ field=models.DecimalField(decimal_places=0, default=1, max_digits=1),
+ preserve_default=False,
+ ),
+ ]
diff --git a/app/resume/migrations/__init__.py b/app/resume/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/resume/migrations/__init__.py
diff --git a/app/resume/models.py b/app/resume/models.py
index a8c9809..95c66f7 100644
--- a/app/resume/models.py
+++ b/app/resume/models.py
@@ -3,6 +3,7 @@ from django.core.urlresolvers import reverse
from utils.widgets import markdown_to_html
+
class Publisher(models.Model):
name = models.CharField(max_length=200)
slug = models.SlugField(max_length=50)
@@ -10,6 +11,10 @@ class Publisher(models.Model):
body_html = models.TextField(null=True, blank=True)
url = models.CharField(max_length=200, blank=True, null=True)
payment_time = models.DecimalField(max_digits=2, decimal_places=0)
+ order = models.DecimalField(max_digits=1, decimal_places=0)
+
+ class Meta:
+ ordering = ('order',)
def __str__(self):
return self.name
diff --git a/app/resume/urls.py b/app/resume/urls.py
index bc54d36..791f834 100644
--- a/app/resume/urls.py
+++ b/app/resume/urls.py
@@ -19,7 +19,7 @@ urlpatterns = [
url(
r'pubs/$',
RedirectView.as_view(url="/resume/pubs/1/", permanent=False),
- name="live-redirect"
+ name="live_redirect"
),
url(
r'^(?P<path>[-\w]+)(?:/(?P<slug>[-\w]+))$',