Brandon Taylor
863ff69719
Fix Sorting by ForeignKey
...
Removed do_inline_sorting_url and get_object_or_404 check in admin. The model_type_id should *always* be passed in.
Removed test that asserted that Categories weren't sortable as part of the Project admin. Categories *should* be sortable as part of Project admin as they are a Sortable ForeignKey.
Fixed object_rep template to pass in model_type_id again.
Updated README.
Version bump to 2.0.21
2016-10-30 11:33:20 -04:00
Brandon Taylor
5566faed5b
Update sortable inline templates for Django 1.10.x compatibility.
2016-08-08 20:36:35 -04:00
Brandon Taylor
e9b03a3a4f
Merge pull request #143 from MagicSolutions/fix/admin-urs
...
Use separate URLs per model in administration to do the sorting
2016-08-03 10:06:29 -04:00
Brandon Taylor
54482b3bb3
Merge branch 'master' into develop
2016-06-23 21:48:45 -04:00
Venelin Stoykov
2697422497
Play nice with other apps which dynamically choose `change_form_template`
...
If other app admin class is using `property` for `change_form_template` adminsortable fails.
2016-06-23 16:02:01 +03:00
Venelin Stoykov
a479198799
Use separate URLs per model in administration to do the sorting
...
- Correctly check if current user has permissions to made the change
Fixes #142
2016-06-16 14:41:03 +03:00
Brandon Taylor
307db84b66
Testing admin url cleanup
2016-06-15 20:25:56 -04:00
Venelin Stoykov
fb6e1118db
Simplify SortableAdmin.get_urls
...
Preserve compatibility
2016-06-15 16:54:07 +03:00
Brandon Taylor
f004d97bf1
Refactored exception handling for order_field_name
2016-03-14 11:09:18 -04:00
Adam M. Peacock
bbb88d57ab
Removed extra comma
2016-02-23 12:29:59 -05:00
Adam M. Peacock
3ef33043d7
Passed csrf_cookie_name into the changelist_form extra_context to support variable CSRF_COOKIE_NAME
2016-02-23 12:25:18 -05:00
Brandon Taylor
c891f25bdf
Merge branch 'develop'
...
Adds custom CSRF_COOKIE_NAME support.
2016-02-16 09:59:50 -05:00
Brandon Taylor
c1181b0e52
Support CSRF_COOKIE_NAME
...
Added support for custom CSRF_COOKIE_NAME by refactoring the jquery.django-csrf.js file into a separate .html file that can be used as an include, passing in the CSRF_COOKIE_NAME from settings.
2016-02-16 08:48:32 -05:00
Brandon Taylor
5823af8047
Merge branch 'master' of github.com:iambrandontaylor/django-admin-sortable
2016-01-27 12:05:12 -05:00
Brandon Taylor
a7a6c12deb
Refactored check for ordering information to keep backwards compatibility with Django 1.5.x
2016-01-27 11:50:42 -05:00
Brandon Taylor
15d8f20178
Fixed merged conflict in __init__.py
...
Removed unused import in admin.py
2016-01-27 11:26:03 -05:00
Brandon Taylor
66c73a6bdc
Fixed access of custom order property in model meta, falling back to order for legacy implementations.
...
Updated readme and version bump to 2.0.10
2016-01-27 10:58:58 -05:00
giacomo
84e42720e7
Fix typo in warning
...
Tabluar -> Tabular
2016-01-12 16:13:15 +01:00
Brandon Taylor
5dee27e077
Added sorting icons.
...
Refactored determination of sortability of classes referenced as sortable foreign keys in admin in a more reliable way.
2015-12-23 16:39:45 -05:00
Brandon Taylor
698ca136d5
Refactored admin url patterns to be compatible with Django 1.8 or higher.
...
Refactored sample_project imports to be compatible with Django 1.9
Updated unit tests for get_next/previous.
Version bump to 2.0.8.
Fixed typo in docs.
2015-12-21 14:11:13 -05:00
Daniel Otero
11e445d99e
Variable jQuery path for Django version 1.9 and above
2015-12-08 22:04:05 +01:00
zakdoek
995baee2d3
Fix bug when used with descending order
2015-10-20 14:11:49 +02:00
Brandon Taylor
bee71e6d40
Refactored order_field_name out of Sortable class, instead deriving from Meta.ordering, since you have to set Meta.ordering to the order field to get the proper Sorting anyway.
2015-09-02 09:38:10 -04:00
Brandon Taylor
6c5a9058fe
Minor PEP8, text and formatting tweaks.
2015-08-24 08:18:22 -04:00
Brandon Taylor
43fef78876
Work in progress on refactoring the Sortable class into a non-obtrusive mixin.
2015-08-23 22:25:55 -04:00
Brandon Taylor
da0da5e690
Fixes: Bug in get_previous() method #108
...
Added ordering to _filter_objects internal method to correctly select previous object.
2015-07-05 22:37:20 -04:00
Brandon Taylor
ad09081ab4
Added exception handling for get_queryset attribute.
2015-04-08 22:06:14 -04:00
ILYA
cbc27663a3
Refactored import from generic module to get rid of DeprecationWarning
2015-02-25 19:38:29 +03:00
mark@ignacio.io
d841ebfbfe
removed print statements
2014-12-27 12:12:47 -05:00
Brandon Taylor
a3c1f4457a
Fixed merge conflicts.
2014-12-22 10:27:46 -05:00
Brandon Taylor
01403f1b8c
Merged pull request 97
2014-12-22 10:25:35 -05:00
matt-leach
c7f2d63ec9
calling the correct queryset/get_queryset for VERSION
2014-12-22 14:44:02 +00:00
matt-leach
cf1a2103dd
Updating VERSION comparison to be compatible with all 1.5.x
2014-12-22 14:36:15 +00:00
Brandon Taylor
d332563e27
Fixed call to queryset object for Django >= 1.7
2014-11-03 10:43:13 -05:00
Brandon Taylor
116a933d92
Updated comments to be clearer.
...
Minor formatting changes.
Cahnged check for sortable_by_class_is_sortable to use new check_model_is_sortable, rather than only relying on the number of objects.
2014-10-24 20:30:14 -04:00
Brandon Taylor
ca2a414ded
Added version specific overrides for get_queryset and get_query_set.
...
Added new get_permissions_codename check for permissions in upcoming Django 1.8.
Refactored all version checks. All checks are done in tuple format instead of checking for a django major and minor version number.
Removed unused RequestFactory in tests.
2014-10-06 08:56:41 -04:00
Brandon Taylor
f33f5e90ed
Refactored do_sorting_view to get start_index default value from len(indexes) rather than duplicate the line and set to 0.
...
Added NonSortableParentAdmin class to enable sorting URLs and JavaScript on models that do not inherit from Sortable.
Removed unused 'ordering' property on SortableAdmin.
Changed assignment of sorting_filters to use getattr, enabling NonSortableParentAdmin to inherit from SortableAdminBase.
Moved template properties to SortableAdminBase.
2014-09-21 15:12:30 -04:00
Brandon Taylor
e08077a0b2
PEP8 cleanup.
2014-09-06 14:51:26 -04:00
Brandon Taylor
27686d6f79
Removed unused variable.
2014-09-06 12:38:00 -04:00
Brandon Taylor
fee0ba81b0
Moved logic to set sortable_foreign_key property to Sortable instead of SortableAdmin.
...
Added instance methods to get next or previous instance, optionally filtered by a sortable foreign key field.
2014-09-05 23:02:29 -04:00
Scott Clark
41fa948bb2
ModelAdmin.change_view takes a form_url kwarg
...
This allows change_view super calls to AdminSortable and
ModelAdmin to play nice with each other.
2014-09-04 14:07:55 -06:00
Brandon Taylor
e19edc7d9e
Merge pull request #81 from EnTeQuAk/feature/python-2.6
...
Fix python 2.6 compatibility
2014-05-29 10:22:15 -04:00
Evgeniy Kirov
357268e9b0
Fix "except"
2014-05-28 16:11:04 +04:00
Christopher Grebs
e4a79e1d62
Fix python 2.6 compatibility
2014-05-26 14:52:46 +02:00
Brandon Taylor
13549da827
Removed un-needed format specificity.
2014-03-05 09:24:32 -05:00
Brandon Taylor
80bdaafdc3
Refactored sorting_filters into a tuple and moved logic for retrieving sorting filters into the sort_view versus changelist_view.
...
Updated readme.
Updated sample project to leverage new sorting_filters on Person model and admin.
Removed custom change list template for Person admin.
2014-03-05 09:10:47 -05:00
Brandon Taylor
95e21eea5e
Merge branch 'order-subset'
2014-02-05 11:13:58 -05:00
Brandon Taylor
1b4730fef9
Added Person model with sorting_filters set to only order people who are board members.
...
Added custom template override to specify which people are sortable in change list.
Added initial data fixture for people.
2014-02-05 11:08:02 -05:00
Brandon Taylor
e51f7535ca
Added Person model with ordering_subset and initial data.
2014-02-05 09:36:03 -05:00
A.Sichkar
cadf41dd1d
Python 2.6.x compatibility fix (unindexed str.format in admin.py
2014-01-13 15:35:23 +02:00