Commit graph

120 commits

Author SHA1 Message Date
Brandon Taylor
99bf2fb5f2 Version bump to 2.2.0
Updated README.
Updated models to be compliant with Django 3.
2019-12-07 17:36:54 -05:00
Brandon Taylor
e2bee04990 Fix sorting for raw_id objects
- Added common function to get querystring filters
- Excluded querystring parameters used for raw_id fields
- Version bump to 2.1.13
- Updated readme
2019-02-21 09:56:08 -05:00
Brandon Taylor
9b143ca58e Applied migrations 2019-02-15 09:08:39 -05:00
Brandon Taylor
598a97c997 Added extra filtering options for Project model/admin 2019-02-11 10:15:39 -05:00
Brandon Taylor
fabd78e5be Add Positional Arguments to Get Next/Previous
Added filter_args array argument to be passed to get_next/previous methods.
Added extra boolean fields to project model for testing.
2018-10-06 09:46:34 -04:00
Brandon Taylor
1ed27acbaa Fix Sort Link
Updated conditional to not add filter expression if a search has been performed on the queryset.
2018-10-05 10:53:56 -04:00
Brandon Taylor
6d5f9e97b4 Added after_sorting method to SortableAdminBase class that can be defined on a model admin to be executed after sorting has occurred. 2018-07-09 07:49:55 -04:00
Brandon Taylor
e35f36b25a Refactored sorting JS files to be includes so that server-side variables may be passed to them.
Added 'after_sorting_js_callback_name' attribute to SortableAdminBase.
Added callback to be executed after sorting for each of the possible sorting scenarios.
Added custom template examples to add a callback to be executed when sorting is finished.
2018-06-18 11:40:24 -04:00
Brandon Taylor
5d1529c161 Updated migrations to allow for a model with a non autofield as the primary key.
Updated tests.
2018-03-19 21:18:08 -04:00
Brandon Taylor
d4f577fdf9 Update csrf value to use value if present in context, then fall back to cookie.
Updated database samples.
Added migrations for sample project models.
Updated Category model to make order not editable.
2017-12-04 22:05:37 -05:00
Brandon Taylor
f4daaeb232 Restructured sample project for Django 2.
Refactored database and changed "app" to "samples" so name didn't conflict with "AppConfig".
Replaced deprecated assignment_tag with simple_tag.
Updated unit tests.
2017-12-04 21:29:55 -05:00
Jaap Roes
de6a768ceb No need to use include for admin.site.urls (it’s deprecated) 2017-03-16 16:21:59 +01:00
Jaap Roes
aa9c4a6063 User.is_authenticated is a property from Django 1.10 and onward 2017-03-16 16:21:59 +01:00
Jaap Roes
a5eca5ea4d assertEquals is deprecated in Python 3 2017-03-16 16:21:59 +01:00
Jaap Roes
e5adadaefc Use the newer MIDDLEWARE setting but fall back to MIDDLEWARE_CLASSES on Django < 1.10 2017-03-16 16:21:59 +01:00
Jaap Roes
defaf45e9a Make it clear why the httplib import is guarded by a try except and has a fallback 2017-03-16 16:21:59 +01:00
Jaap Roes
b8bfbe0c9a Explicitly set on_delete=models.CASCADE on ForeignKey as it will be required in Django 2.0 2017-03-16 16:21:59 +01:00
Jaap Roes
9d3c958365 Remove deprecated template settings 2017-03-16 16:21:59 +01:00
Jaap Roes
7262cb6564 Remove unused utils module 2017-03-16 16:21:59 +01:00
Jaap Roes
28fe5d1460 Run non auto field model test unconditional 2017-03-16 16:21:59 +01:00
Jaap Roes
9997644929 Run uuid field tests unconditional 2017-03-16 16:21:59 +01:00
Jaap Roes
ac507e4484 Remove get_queryset fallback 2017-03-16 16:21:58 +01:00
Jaap Roes
74e0c92455 Remove contenttypes.generic import fallbacks 2017-03-16 16:21:58 +01:00
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
6e6b92d759 Skipped UUID-pk model if Django less than 1.8 2016-10-12 22:14:22 -04:00
Brandon Taylor
bf75b85190 Skipped UUI import for Django less than 1.8 2016-10-12 22:07:54 -04:00
Brandon Taylor
76378483ff Skipped UUID pk test for less than Django 1.8 2016-10-12 22:03:22 -04:00
Brandon Taylor
fcf2829633 Skipped UUID pk test if less than Django 1.7 2016-10-12 21:50:42 -04:00
Ruben Dura Tari
e4355d84bc Adds test 2016-10-11 19:47:17 +01: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
Steven H Johnson
f850e639c9 Add help text to test tabular icons between django 1.8 and 1.9 2016-07-09 16:31:36 -04:00
Venelin Stoykov
684864be33 Update sample project for latest django versions 2016-06-24 14:06:54 +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
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
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
Brandon Taylor
3757ca98c0 Added extra JS to deterine which element to highlight in the case where all fieldsets of a stacked inline are set to collapse. 2015-11-18 09:20:45 -05:00
Brandon Taylor
5d1a6f5e98 Updated readme.
Version bump to 2.0.3
2015-10-20 09:05:52 -04:00
Brandon Taylor
6c44bbb2a5 Added some test data. 2015-09-07 21:41:24 -04: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
74a6cadf8d Added legacy model definition back for seamless backwards compatibility.
Updated readme.
Added sample legacy model implementation.
2015-08-24 12:55:56 -04:00
Brandon Taylor
827f5f092e Removed migrations from sample_project. 2015-08-24 11:48:30 -04:00
Brandon Taylor
64b8b9dc39 Added model with custom order field and inline model with custom order field example. 2015-08-24 08:04:05 -04:00
Brandon Taylor
b14d747f82 Work in progress on refactoring the Sortable class into a non-obtrusive mixin. 2015-08-23 22:23:45 -04:00
Brandon Taylor
51ed60a127 Refactored unit test. 2015-07-05 23:03:59 -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
d7e0ec45fa Refactored test for get_previous and get_next to iterate through all records for people. 2015-06-29 23:43:41 -04:00
Brandon Taylor
ef05c0f7cb Version bump to 1.8.3.
Updated readme with 1.8.3 information.
Updated travis configuration to remove deprecated config settings.
2015-04-08 22:16:20 -04:00
tomd
7f0519afbe Fix sort changelist for objects with sortable fk
Loading the test app '/admin/app/project/sort/' changelist failed with
the following error:

UnboundLocalError: local variable 'objects' referenced before assignment

(utils.py, check_model_is_sortable)

See test sample_app test_adminsortable_change_list_view_loads_with_sortable_fk
2015-01-12 15:40:33 +00:00
Brandon Taylor
34e5d62245 Fixed merge conflict. 2014-12-22 10:30:56 -05:00