Fixed unicode support for title context variable in sort view.

Updated version to 1.4.5.1
Updated README.
master
Brandon Taylor 2013-04-30 08:36:46 -04:00
parent 014f6d1660
commit 32c6f7c034
4 changed files with 8 additions and 23 deletions

View File

@ -203,10 +203,8 @@ ordering on top of that just seemed a little much in my opinion.
django-admin-sortable is currently used in production. django-admin-sortable is currently used in production.
### What's new in 1.4.5? ### What's new in 1.4.5.1?
- Support for queryset overrides! - Fixed unicode support in sort view title.
- More efficient JavaScript in sortables
- Fixed highlight effect for stacked inlines on sort finish
### Future ### Future

View File

@ -1,11 +1,13 @@
VERSION = (1, 4, 5) # following PEP 386 VERSION = (1, 4, 5, 1) # following PEP 386
DEV_N = None DEV_N = None
def get_version(): def get_version():
version = "%s.%s" % (VERSION[0], VERSION[1]) version = '{0}.{1}'.format(VERSION[0], VERSION[1])
if VERSION[2]: if VERSION[2]:
version = "%s.%s" % (version, VERSION[2]) version = '{0}.{1}'.format(version, VERSION[2])
if VERSION[3]:
version = '{0}.{1}'.format(version, VERSION[3])
return version return version

View File

@ -69,21 +69,6 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
break break
return sortable_foreign_key return sortable_foreign_key
# def __init__(self, *args, **kwargs):
# super(SortableAdmin, self).__init__(*args, **kwargs)
# self.has_sortable_tabular_inlines = False
# self.has_sortable_stacked_inlines = False
# for klass in self.inlines:
# print type(klass)
# is_sortable = get_is_sortable(
# klass.model._default_manager.get_query_set())
# print is_sortable
# if issubclass(klass, SortableTabularInline) and is_sortable:
# self.has_sortable_tabular_inlines = True
# if issubclass(klass, SortableStackedInline) and is_sortable:
# self.has_sortable_stacked_inlines = True
def get_urls(self): def get_urls(self):
urls = super(SortableAdmin, self).get_urls() urls = super(SortableAdmin, self).get_urls()
admin_urls = patterns('', admin_urls = patterns('',
@ -158,7 +143,7 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
verbose_name_plural = opts.verbose_name_plural verbose_name_plural = opts.verbose_name_plural
context = { context = {
'title': 'Drag and drop {0} to change display order'.format( 'title': u'Drag and drop {0} to change display order'.format(
capfirst(verbose_name_plural)), capfirst(verbose_name_plural)),
'opts': opts, 'opts': opts,
'app_label': opts.app_label, 'app_label': opts.app_label,