From 932fc0985e3e94feecb012fff4c873c917d9f5be Mon Sep 17 00:00:00 2001 From: luxagraf Date: Thu, 17 Jan 2019 10:35:34 -0600 Subject: updated resume app --- app/resume/admin.py | 4 +++- app/resume/migrations/0011_auto_20190114_0227.py | 23 +++++++++++++++++++++++ app/resume/models.py | 6 ++++++ app/resume/urls.py | 12 ++++++------ 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 app/resume/migrations/0011_auto_20190114_0227.py (limited to 'app/resume') 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 @@ -6,11 +6,6 @@ from . import views app_name = "resume" urlpatterns = [ - path( - r'', - views.ResumeView.as_view(), - name='resume', - ), path( r'pubs//', views.PublisherListView.as_view(), @@ -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'', + views.ResumeView.as_view(), + name='resume', + ), ] -- cgit v1.2.3-70-g09d2