added django-sortedm2m
This commit is contained in:
parent
4b53e94a97
commit
815535c4bf
3 changed files with 28 additions and 4 deletions
22
djangocms_blog/migrations/0031_auto_20170610_1744.py
Normal file
22
djangocms_blog/migrations/0031_auto_20170610_1744.py
Normal 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'),
|
||||
),
|
||||
]
|
|
@ -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',
|
||||
|
|
1
setup.py
1
setup.py
|
@ -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'],
|
||||
|
|
Loading…
Add table
Reference in a new issue