diff options
Diffstat (limited to 'app/jrnl')
-rw-r--r-- | app/jrnl/admin.py | 4 | ||||
-rw-r--r-- | app/jrnl/migrations/0032_entry_subtitle.py | 18 | ||||
-rw-r--r-- | app/jrnl/models.py | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/app/jrnl/admin.py b/app/jrnl/admin.py index 1769ebe..3c35272 100644 --- a/app/jrnl/admin.py +++ b/app/jrnl/admin.py @@ -21,6 +21,9 @@ class EntryAdmin(OSMGeoAdmin): def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'thumbnail' or db_field.name == 'image': field = forms.FileField(widget=AdminImageWidget) + elif db_field.name == 'meta_description': + field = forms.CharField(widget=forms.Textarea(attrs={'rows': 4, 'cols': 75})) + field.required = False else: field = super(EntryAdmin, self).formfield_for_dbfield(db_field, **kwargs) return field @@ -34,6 +37,7 @@ class EntryAdmin(OSMGeoAdmin): ('Entry', { 'fields': ( 'title', + 'subtitle', 'body_markdown', ('pub_date', 'status'), 'slug', diff --git a/app/jrnl/migrations/0032_entry_subtitle.py b/app/jrnl/migrations/0032_entry_subtitle.py new file mode 100644 index 0000000..d5ccc80 --- /dev/null +++ b/app/jrnl/migrations/0032_entry_subtitle.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2019-02-28 09:41 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('jrnl', '0031_auto_20190220_1136'), + ] + + operations = [ + migrations.AddField( + model_name='entry', + name='subtitle', + field=models.CharField(blank=True, max_length=200), + ), + ] diff --git a/app/jrnl/models.py b/app/jrnl/models.py index 16ccf49..ef25a40 100644 --- a/app/jrnl/models.py +++ b/app/jrnl/models.py @@ -37,6 +37,7 @@ def image_url_replace(s): class Entry(models.Model): title = models.CharField(max_length=200) + subtitle = models.CharField(max_length=200, blank=True) slug = models.SlugField(unique_for_date='pub_date') body_html = models.TextField(blank=True) body_markdown = models.TextField() |