Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to django-filter v2 #148

Merged
merged 4 commits into from
Jan 16, 2020
Merged

Upgrade to django-filter v2 #148

merged 4 commits into from
Jan 16, 2020

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Dec 13, 2019

  • Remove Backports Library
  • Drop Python2 and Python3.5 Support
  • Update Tests
  • Update Modules ( Models, Serializers, Viewsets, etc.)

Fix #136

Previous PR #138

@DavisRayM DavisRayM changed the title Upgrade to django-filter v2 [WIP] Upgrade to django-filter v2 Dec 13, 2019
- Remove Backports Package
- Use tempfile lib
- Update tests
- Update models, serializers and viewsets
- Remove tox and travis python2 environments
- Remove Future Package
- Remove Future Module Dependency
- Modify setup.cfg
@DavisRayM DavisRayM force-pushed the 136-upgrade-tasking branch 4 times, most recently from a8e75ef to 6a6f738 Compare January 15, 2020 14:37
@DavisRayM DavisRayM changed the title [WIP] Upgrade to django-filter v2 Upgrade to django-filter v2 Jan 15, 2020
@DavisRayM DavisRayM mentioned this pull request Jan 15, 2020
2 tasks
tasking/apps.py Show resolved Hide resolved
@@ -1,10 +1,8 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you comment on what necessitated the changes in this module?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new django-filter doesn't support passing lists to lookup_expr like we used to do before. Needed to create a separate filter backend TaskOccurrenceFilter to handle the filtering of task occurrences from the tasks endpoint.

@@ -25,7 +21,7 @@ def test_submission_model_str(self):
submission = mommy.make(
'tasking.Submission',
task=cattle,
_fill_optional=['user', 'comment', 'submission_time'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the effects of changing from comment to comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment field doesn't exist for the Submission model.

expected = 'Cow prices - {}'.format(cow_price.pk)
self.assertEqual(expected, six.text_type(cow_price))
expected = f'Cow prices - {cow_price.pk}'
self.assertEqual(expected, str(cow_price))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the str necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was testing the string representation of the object. I can replace this with a call to __str__() though.

- Update Pipfile Lock
- Update tests
- Update TaskFilterSet to utilize LookUpChoiceFilter
@DavisRayM DavisRayM merged commit 150c05b into master Jan 16, 2020
@DavisRayM DavisRayM deleted the 136-upgrade-tasking branch January 16, 2020 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to django-filter v2
2 participants