Refactored exception handling for order_field_name
parent
f44220c3de
commit
f004d97bf1
|
|
@ -2,7 +2,11 @@
|
||||||
|
|
||||||
[](https://travis-ci.org/iambrandontaylor/django-admin-sortable)
|
[](https://travis-ci.org/iambrandontaylor/django-admin-sortable)
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
Current version: 2.0.12
|
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
|
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,
|
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.
|
django-admin-sortable is currently used in production.
|
||||||
|
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
### What's new in 2.0.12?
|
### 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.
|
- 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
|
### Future
|
||||||
|
|
|
||||||
11
README.rst
11
README.rst
|
|
@ -3,7 +3,11 @@ Django Admin Sortable
|
||||||
|
|
||||||
|Build Status|
|
|Build Status|
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
Current version: 2.0.12
|
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
|
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,
|
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.
|
django-admin-sortable is currently used in production.
|
||||||
|
|
||||||
|
<<<<<<< Updated upstream
|
||||||
What's new in 2.0.12?
|
What's new in 2.0.12?
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
- Fixed an issue with CSRF\_COOKIE\_NAME not being passed correctly to
|
- Fixed an issue with CSRF\_COOKIE\_NAME not being passed correctly to
|
||||||
inlines. Thanks [@Hovercross](https://github.com/Hovercross) for
|
inlines. Thanks [@Hovercross](https://github.com/Hovercross) for
|
||||||
reporting the issue.
|
reporting the issue.
|
||||||
|
=======
|
||||||
|
What's new in 2.0.14?
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
- Refactored exception handling when determining ``order_field_name``
|
||||||
|
>>>>>>> Stashed changes
|
||||||
|
|
||||||
Future
|
Future
|
||||||
~~~~~~
|
~~~~~~
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
|
<<<<<<< Updated upstream
|
||||||
VERSION = (2, 0, 12)
|
VERSION = (2, 0, 12)
|
||||||
|
=======
|
||||||
|
VERSION = (2, 0, 14)
|
||||||
|
>>>>>>> Stashed changes
|
||||||
DEV_N = None
|
DEV_N = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ class SortableAdmin(SortableAdminBase, ModelAdmin):
|
||||||
except (AttributeError, IndexError):
|
except (AttributeError, IndexError):
|
||||||
# for Django 1.5.x
|
# for Django 1.5.x
|
||||||
order_field_name = opts.ordering[0]
|
order_field_name = opts.ordering[0]
|
||||||
finally:
|
except (AttributeError, IndexError):
|
||||||
order_field_name = 'order'
|
order_field_name = 'order'
|
||||||
|
|
||||||
objects = objects.order_by(sortable_by_expression, order_field_name)
|
objects = objects.order_by(sortable_by_expression, order_field_name)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue