Refactored exception handling for order_field_name
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
|
||||
[](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
|
||||
|
||||
+11
@@ -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
|
||||
~~~~~~
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<<<<<<< Updated upstream
|
||||
VERSION = (2, 0, 12)
|
||||
=======
|
||||
VERSION = (2, 0, 14)
|
||||
>>>>>>> Stashed changes
|
||||
DEV_N = None
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user