Refactored exception handling for order_field_name

master
Brandon Taylor 2016-03-14 11:09:18 -04:00
parent f44220c3de
commit f004d97bf1
4 changed files with 25 additions and 1 deletions

View File

@ -2,7 +2,11 @@
[![Build Status](https://travis-ci.org/iambrandontaylor/django-admin-sortable.svg?branch=master)](https://travis-ci.org/iambrandontaylor/django-admin-sortable)
<<<<<<< Updated upstream
Current version: 2.0.12
=======
Current version: 2.0.14
>>>>>>> Stashed changes
This project makes it easy to add drag-and-drop ordering to any model in
Django admin. Inlines for a sortable model may also be made sortable,
@ -497,8 +501,13 @@ ordering on top of that just seemed a little much in my opinion.
django-admin-sortable is currently used in production.
<<<<<<< Updated upstream
### What's new in 2.0.12?
- Fixed an issue with CSRF_COOKIE_NAME not being passed correctly to inlines. Thanks [@Hovercross](https://github.com/Hovercross) for reporting the issue.
=======
### What's new in 2.0.14?
- Refactored exception handling when determining `order_field_name`
>>>>>>> Stashed changes
### Future

View File

@ -3,7 +3,11 @@ Django Admin Sortable
|Build Status|
<<<<<<< Updated upstream
Current version: 2.0.12
=======
Current version: 2.0.14
>>>>>>> Stashed changes
This project makes it easy to add drag-and-drop ordering to any model in
Django admin. Inlines for a sortable model may also be made sortable,
@ -611,12 +615,19 @@ Status
django-admin-sortable is currently used in production.
<<<<<<< Updated upstream
What's new in 2.0.12?
~~~~~~~~~~~~~~~~~~~~~
- Fixed an issue with CSRF\_COOKIE\_NAME not being passed correctly to
inlines. Thanks [@Hovercross](https://github.com/Hovercross) for
reporting the issue.
=======
What's new in 2.0.14?
~~~~~~~~~~~~~~~~~~~~~
- Refactored exception handling when determining ``order_field_name``
>>>>>>> Stashed changes
Future
~~~~~~

View File

@ -1,4 +1,8 @@
<<<<<<< Updated upstream
VERSION = (2, 0, 12)
=======
VERSION = (2, 0, 14)
>>>>>>> Stashed changes
DEV_N = None

View File

@ -194,7 +194,7 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
except (AttributeError, IndexError):
# for Django 1.5.x
order_field_name = opts.ordering[0]
finally:
except (AttributeError, IndexError):
order_field_name = 'order'
objects = objects.order_by(sortable_by_expression, order_field_name)