Revert "Post ordering functionality added"
This reverts commit eebe16c8f5
.
This commit is contained in:
parent
1bb0ac8c75
commit
fbd9eb0066
4 changed files with 3 additions and 31 deletions
|
@ -3,7 +3,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
|
||||
from copy import deepcopy
|
||||
|
||||
from adminsortable.admin import SortableAdmin
|
||||
from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig
|
||||
from cms.admin.placeholderadmin import FrontendEditableAdminMixin, PlaceholderAdminMixin
|
||||
from cms.models import CMSPlugin, ValidationError
|
||||
|
@ -74,7 +73,7 @@ class BlogCategoryAdmin(EnhancedModelAdminMixin, ModelAppHookConfig, Translatabl
|
|||
|
||||
|
||||
class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
||||
ModelAppHookConfig, TranslatableAdmin, SortableAdmin):
|
||||
ModelAppHookConfig, TranslatableAdmin):
|
||||
form = PostAdminForm
|
||||
list_display = [
|
||||
'title', 'author', 'date_published', 'app_config', 'all_languages_column',
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-04-11 09:26
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('djangocms_blog', '0029_post_related'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='post',
|
||||
options={'get_latest_by': 'date_published', 'ordering': ('post_order', '-date_published', '-date_created'), 'verbose_name': 'blog article', 'verbose_name_plural': 'blog articles'},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='post',
|
||||
name='post_order',
|
||||
field=models.PositiveIntegerField(db_index=True, default=0, editable=False),
|
||||
),
|
||||
]
|
|
@ -3,7 +3,6 @@ from __future__ import absolute_import, print_function, unicode_literals
|
|||
|
||||
import hashlib
|
||||
|
||||
from adminsortable.models import SortableMixin
|
||||
from aldryn_apphooks_config.fields import AppHookConfigField
|
||||
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
|
||||
from cms.models import CMSPlugin, PlaceholderField
|
||||
|
@ -131,7 +130,7 @@ class BlogCategory(TranslatableModel):
|
|||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
||||
class Post(KnockerModel, ModelMeta, TranslatableModel):
|
||||
"""
|
||||
Blog post
|
||||
"""
|
||||
|
@ -196,7 +195,6 @@ class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
|||
verbose_name=_('Related Posts'),
|
||||
blank=True,
|
||||
symmetrical=False)
|
||||
post_order = models.PositiveIntegerField(default=0, editable=False, db_index=True)
|
||||
|
||||
_metadata = {
|
||||
'title': 'get_title',
|
||||
|
@ -229,7 +227,7 @@ class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
|||
class Meta:
|
||||
verbose_name = _('blog article')
|
||||
verbose_name_plural = _('blog articles')
|
||||
ordering = ('post_order', '-date_published', '-date_created')
|
||||
ordering = ('-date_published', '-date_created')
|
||||
get_latest_by = 'date_published'
|
||||
|
||||
def __str__(self):
|
||||
|
|
1
setup.py
1
setup.py
|
@ -40,7 +40,6 @@ setup(
|
|||
'django-meta-mixin>=0.3',
|
||||
'aldryn-apphooks-config>=0.2.6',
|
||||
'djangocms-apphook-setup',
|
||||
'django-admin-sortable',
|
||||
],
|
||||
extras_require={
|
||||
'search': ['aldryn-search'],
|
||||
|
|
Loading…
Reference in a new issue