Realted post field added

This commit is contained in:
Dipen Patel 2017-04-07 13:09:51 +05:30
parent dabe9c01d0
commit b2fbf1123c
3 changed files with 23 additions and 1 deletions

View file

@ -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'],

View 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'),
),
]

View file

@ -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',