summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/resume/admin.py4
-rw-r--r--app/resume/migrations/0011_auto_20190114_0227.py23
-rw-r--r--app/resume/models.py6
-rw-r--r--app/resume/urls.py12
4 files changed, 38 insertions, 7 deletions
diff --git a/app/resume/admin.py b/app/resume/admin.py
index 0a7594d..bf4f8a0 100644
--- a/app/resume/admin.py
+++ b/app/resume/admin.py
@@ -1,5 +1,6 @@
from django.contrib import admin
+from utils.widgets import LGEntryForm
from .models import Publisher, PubItem, Job, Resume
@@ -17,7 +18,8 @@ class ResumeAdmin(admin.ModelAdmin):
class PublisherAdmin(admin.ModelAdmin):
pass
+
@admin.register(PubItem)
class PubItemAdmin(admin.ModelAdmin):
+ form = LGEntryForm
list_display = ('title', 'pub_date', 'publisher', 'admin_link')
- pass
diff --git a/app/resume/migrations/0011_auto_20190114_0227.py b/app/resume/migrations/0011_auto_20190114_0227.py
new file mode 100644
index 0000000..7656c6e
--- /dev/null
+++ b/app/resume/migrations/0011_auto_20190114_0227.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.1.1 on 2019-01-14 02:27
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('resume', '0010_auto_20190113_1147'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='resume',
+ name='profile_html',
+ field=models.TextField(blank=True),
+ ),
+ migrations.AddField(
+ model_name='resume',
+ name='skills_html',
+ field=models.TextField(blank=True),
+ ),
+ ]
diff --git a/app/resume/models.py b/app/resume/models.py
index 390a277..2161e88 100644
--- a/app/resume/models.py
+++ b/app/resume/models.py
@@ -80,7 +80,9 @@ class Resume(models.Model):
title = models.CharField(max_length=200)
slug = models.CharField(max_length=50, blank=True)
profile = models.TextField()
+ profile_html = models.TextField(blank=True)
skills = models.TextField()
+ skills_html = models.TextField(blank=True)
jobs = models.ManyToManyField(Job)
def __str__(self):
@@ -89,4 +91,8 @@ class Resume(models.Model):
def save(self, *args, **kwargs):
if self._state.adding and not self.slug:
self.slug = slugify(self.title)
+ if self.skills:
+ self.skills_html = markdown_to_html(self.skills)
+ if self.profile:
+ self.profile_html = markdown_to_html(self.profile)
super(Resume, self).save()
diff --git a/app/resume/urls.py b/app/resume/urls.py
index 47e07ad..0f74c70 100644
--- a/app/resume/urls.py
+++ b/app/resume/urls.py
@@ -7,11 +7,6 @@ app_name = "resume"
urlpatterns = [
path(
- r'<str:slug>',
- views.ResumeView.as_view(),
- name='resume',
- ),
- path(
r'pubs/<str:page>/',
views.PublisherListView.as_view(),
name='list',
@@ -33,7 +28,7 @@ urlpatterns = [
name="live_publisher_redirect"
),
path(
- r'pubs/',
+ r'pubs',
RedirectView.as_view(url="/resume/pubs/1/", permanent=False),
name="live_redirect"
),
@@ -42,4 +37,9 @@ urlpatterns = [
views.PageView.as_view(),
name="pages"
),
+ path(
+ r'<str:slug>',
+ views.ResumeView.as_view(),
+ name='resume',
+ ),
]