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 copy import deepcopy
|
||||||
|
|
||||||
from adminsortable.admin import SortableAdmin
|
|
||||||
from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig
|
from aldryn_apphooks_config.admin import BaseAppHookConfig, ModelAppHookConfig
|
||||||
from cms.admin.placeholderadmin import FrontendEditableAdminMixin, PlaceholderAdminMixin
|
from cms.admin.placeholderadmin import FrontendEditableAdminMixin, PlaceholderAdminMixin
|
||||||
from cms.models import CMSPlugin, ValidationError
|
from cms.models import CMSPlugin, ValidationError
|
||||||
|
@ -74,7 +73,7 @@ class BlogCategoryAdmin(EnhancedModelAdminMixin, ModelAppHookConfig, Translatabl
|
||||||
|
|
||||||
|
|
||||||
class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
||||||
ModelAppHookConfig, TranslatableAdmin, SortableAdmin):
|
ModelAppHookConfig, TranslatableAdmin):
|
||||||
form = PostAdminForm
|
form = PostAdminForm
|
||||||
list_display = [
|
list_display = [
|
||||||
'title', 'author', 'date_published', 'app_config', 'all_languages_column',
|
'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
|
import hashlib
|
||||||
|
|
||||||
from adminsortable.models import SortableMixin
|
|
||||||
from aldryn_apphooks_config.fields import AppHookConfigField
|
from aldryn_apphooks_config.fields import AppHookConfigField
|
||||||
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
|
from aldryn_apphooks_config.managers.parler import AppHookConfigTranslatableManager
|
||||||
from cms.models import CMSPlugin, PlaceholderField
|
from cms.models import CMSPlugin, PlaceholderField
|
||||||
|
@ -131,7 +130,7 @@ class BlogCategory(TranslatableModel):
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
class Post(KnockerModel, ModelMeta, TranslatableModel):
|
||||||
"""
|
"""
|
||||||
Blog post
|
Blog post
|
||||||
"""
|
"""
|
||||||
|
@ -196,7 +195,6 @@ class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
||||||
verbose_name=_('Related Posts'),
|
verbose_name=_('Related Posts'),
|
||||||
blank=True,
|
blank=True,
|
||||||
symmetrical=False)
|
symmetrical=False)
|
||||||
post_order = models.PositiveIntegerField(default=0, editable=False, db_index=True)
|
|
||||||
|
|
||||||
_metadata = {
|
_metadata = {
|
||||||
'title': 'get_title',
|
'title': 'get_title',
|
||||||
|
@ -229,7 +227,7 @@ class Post(SortableMixin, KnockerModel, ModelMeta, TranslatableModel):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('blog article')
|
verbose_name = _('blog article')
|
||||||
verbose_name_plural = _('blog articles')
|
verbose_name_plural = _('blog articles')
|
||||||
ordering = ('post_order', '-date_published', '-date_created')
|
ordering = ('-date_published', '-date_created')
|
||||||
get_latest_by = 'date_published'
|
get_latest_by = 'date_published'
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -40,7 +40,6 @@ setup(
|
||||||
'django-meta-mixin>=0.3',
|
'django-meta-mixin>=0.3',
|
||||||
'aldryn-apphooks-config>=0.2.6',
|
'aldryn-apphooks-config>=0.2.6',
|
||||||
'djangocms-apphook-setup',
|
'djangocms-apphook-setup',
|
||||||
'django-admin-sortable',
|
|
||||||
],
|
],
|
||||||
extras_require={
|
extras_require={
|
||||||
'search': ['aldryn-search'],
|
'search': ['aldryn-search'],
|
||||||
|
|
Loading…
Reference in a new issue