Added markdown field
This commit is contained in:
parent
d8a8d4467b
commit
51c9cf3c62
|
@ -24,7 +24,7 @@ class EntryAdmin(VersionAdmin):
|
|||
list_display = ('title', 'date', 'status', 'tag_list', 'preview_link')
|
||||
list_display_links = ('title', )
|
||||
list_filter = ('date', 'draft', )
|
||||
search_fields = ('title', 'content', )
|
||||
search_fields = ('title', 'content', 'markdown', )
|
||||
|
||||
filter_horizontal = ('tags',)
|
||||
|
||||
|
@ -48,6 +48,11 @@ class EntryAdmin(VersionAdmin):
|
|||
'classes': ('suit-tab suit-tab-content full-width wide',),
|
||||
'fields': ('content', )
|
||||
}),
|
||||
('Markdown', {
|
||||
'classes': ('suit-tab suit-tab-content full-width collapse',),
|
||||
'fields': ('markdown', )
|
||||
}),
|
||||
|
||||
]
|
||||
|
||||
def preview_link(self, obj):
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.9.4 on 2016-03-13 09:51
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('blog', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='entry',
|
||||
name='markdown',
|
||||
field=models.TextField(blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='entry',
|
||||
name='tags',
|
||||
field=models.ManyToManyField(blank=True, to='blog.Tag'),
|
||||
),
|
||||
]
|
|
@ -12,6 +12,7 @@ class Entry(models.Model):
|
|||
title = models.CharField(max_length=128)
|
||||
date = models.DateTimeField()
|
||||
content = models.TextField()
|
||||
markdown = models.TextField(blank=True)
|
||||
slug = models.SlugField(max_length=128)
|
||||
draft = models.BooleanField(default=True)
|
||||
author = models.ForeignKey(
|
||||
|
|
Loading…
Reference in New Issue