Sort smartlinks by label.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-13 15:27:19 -04:00
committed by Roberto Rosario
parent f3c5391d54
commit a172538dfc
3 changed files with 29 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ Next (2018-XX-XX)
- Split documents.tests.test_views into base.py, test_deleted_document_views.py,
test_document_page_views.py, test_document_type_views.py, test_document_version_views.py,
test_document_views.py, test_duplicated_document_views.py
- Sort smart links by label.
2.8 (2018-02-27)
================

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-13 19:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('linking', '0001_initial_squashed_0005_auto_20150729_2344'),
]
operations = [
migrations.AlterModelOptions(
name='smartlink',
options={'ordering': ('label',), 'verbose_name': 'Smart link', 'verbose_name_plural': 'Smart links'},
),
migrations.AlterField(
model_name='smartlink',
name='label',
field=models.CharField(db_index=True, max_length=96, verbose_name='Label'),
),
]

View File

@@ -16,7 +16,9 @@ from .managers import SmartLinkManager
@python_2_unicode_compatible
class SmartLink(models.Model):
label = models.CharField(max_length=96, verbose_name=_('Label'))
label = models.CharField(
db_index=True, max_length=96, verbose_name=_('Label')
)
dynamic_label = models.CharField(
blank=True, max_length=96, help_text=_(
'Enter a template to render. '
@@ -90,6 +92,7 @@ class SmartLink(models.Model):
)
class Meta:
ordering = ('label',)
verbose_name = _('Smart link')
verbose_name_plural = _('Smart links')