Realted post field added
This commit is contained in:
parent
dabe9c01d0
commit
b2fbf1123c
3 changed files with 23 additions and 1 deletions
|
@ -86,7 +86,7 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
|||
enhance_exclude = ('main_image', 'tags')
|
||||
_fieldsets = [
|
||||
(None, {
|
||||
'fields': [['title', 'categories', 'publish', 'app_config']]
|
||||
'fields': [['title', 'categories', 'publish', 'app_config'], ['related',]]
|
||||
}),
|
||||
(_('Info'), {
|
||||
'fields': [['slug', 'tags'],
|
||||
|
|
20
djangocms_blog/migrations/0029_post_related.py
Normal file
20
djangocms_blog/migrations/0029_post_related.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-04-07 07:35
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('djangocms_blog', '0028_auto_20170304_1040'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='related',
|
||||
field=models.ManyToManyField(blank=True, to='djangocms_blog.Post', verbose_name='Related Posts'),
|
||||
),
|
||||
]
|
|
@ -191,6 +191,8 @@ class Post(KnockerModel, ModelMeta, TranslatableModel):
|
|||
objects = GenericDateTaggedManager()
|
||||
tags = TaggableManager(blank=True, related_name='djangocms_blog_tags')
|
||||
|
||||
related = models.ManyToManyField('self', verbose_name=_('Related Posts'), blank=True, symmetrical=False)
|
||||
|
||||
_metadata = {
|
||||
'title': 'get_title',
|
||||
'description': 'get_description',
|
||||
|
|
Loading…
Reference in a new issue