diff options
author | luxagraf <sng@luxagraf.net> | 2015-12-07 21:31:43 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-12-07 21:31:43 -0500 |
commit | 5dc9b251a29c79fdd0dafc9ef79318e8f213cb3a (patch) | |
tree | 4b586df9bac055907ae35f94c1c7fa67f40a3465 /app/pages | |
parent | 6ad212ae8a542e93d173c2b8e6efcd68109380c8 (diff) |
added builder to resume section
Diffstat (limited to 'app/pages')
-rw-r--r-- | app/pages/admin.py | 2 | ||||
-rw-r--r-- | app/pages/migrations/0003_page_app.py | 20 | ||||
-rw-r--r-- | app/pages/models.py | 6 |
3 files changed, 26 insertions, 2 deletions
diff --git a/app/pages/admin.py b/app/pages/admin.py index 977a0cf..b5e41b4 100644 --- a/app/pages/admin.py +++ b/app/pages/admin.py @@ -22,7 +22,7 @@ class PageAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ('title',)} fieldsets = ( ('Page', { - 'fields': ('title', 'body_markdown', ('slug', 'path')), + 'fields': ('title', 'body_markdown', ('slug', 'path', 'app')), 'classes': ('show', 'extrapretty', 'wide') }), ('Metadata', { diff --git a/app/pages/migrations/0003_page_app.py b/app/pages/migrations/0003_page_app.py new file mode 100644 index 0000000..5edf898 --- /dev/null +++ b/app/pages/migrations/0003_page_app.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2015-12-07 20:28 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0002_page_path'), + ] + + operations = [ + migrations.AddField( + model_name='page', + name='app', + field=models.CharField(blank=True, max_length=50, null=True), + ), + ] diff --git a/app/pages/models.py b/app/pages/models.py index 9b7be7f..0bbd069 100644 --- a/app/pages/models.py +++ b/app/pages/models.py @@ -11,12 +11,16 @@ class Page(models.Model): body_markdown = models.TextField() meta_description = models.CharField(max_length=256, null=True, blank=True) path = models.CharField(max_length=200, null=True, blank=True) + app = models.CharField(max_length=50, null=True, blank=True) def __unicode__(self): return self.title def get_absolute_url(self): - return "/%s/" % (self.slug) + if self.path: + return "/%s/%s" % (self.path, self.slug) + else: + return "/%s" % (self.slug) def save(self): # run markdown |