added django-sortedm2m

This commit is contained in:
Dipen Patel 2017-06-10 18:14:57 +05:30
parent 4b53e94a97
commit 815535c4bf
3 changed files with 28 additions and 4 deletions

View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-06-10 12:14
from __future__ import unicode_literals
from django.db import migrations
import sortedm2m.fields
from sortedm2m.operations import AlterSortedManyToManyField
class Migration(migrations.Migration):
dependencies = [
('djangocms_blog', '0030_auto_20170509_1831'),
]
operations = [
AlterSortedManyToManyField(
model_name='post',
name='related',
field=sortedm2m.fields.SortedManyToManyField(blank=True, help_text=None, to='djangocms_blog.Post', verbose_name='Related Posts'),
),
]

View file

@ -26,6 +26,7 @@ from meta.models import ModelMeta
from parler.models import TranslatableModel, TranslatedFields
from parler.utils.context import switch_language
from taggit_autosuggest.managers import TaggableManager
from sortedm2m.fields import SortedManyToManyField
from .cms_appconfig import BlogConfig
from .managers import GenericDateTaggedManager
@ -193,10 +194,10 @@ 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)
related = SortedManyToManyField('self',
verbose_name=_('Related Posts'),
blank=True,
symmetrical=False)
_metadata = {
'title': 'get_title',

View file

@ -40,6 +40,7 @@ setup(
'django-meta-mixin>=0.3',
'aldryn-apphooks-config>=0.2.6',
'djangocms-apphook-setup',
'django-sortedm2m',
],
extras_require={
'search': ['aldryn-search'],