Skip to content

Support for transforms in fieldnames #112

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

Closed
wants to merge 2 commits into from
Closed

Conversation

aodin
Copy link

@aodin aodin commented Apr 18, 2019

In order to support transforms in fieldnames (e.g. datetime__year), I added AttributeError to the caught expections of io.to_fields. This changes the try block to match what is found in the Django ORM source, which prevents the AttributeError that would be raised by to_fields attempting to parse year as a related field instead of a transform.

Improper transforms or non-existent relations will still raise django.core.exceptions.FieldError during the try_transform of query processing in the Django ORM.

@coveralls
Copy link

Coverage Status

Coverage decreased (-6.7%) to 83.537% when pulling 8acb337 on aodin:master into 8276d69 on chrisdev:master.

@coveralls
Copy link

coveralls commented Apr 18, 2019

Coverage Status

Coverage remained the same at 90.244% when pulling 9b27ec1 on aodin:master into 8276d69 on chrisdev:master.

@aodin
Copy link
Author

aodin commented Apr 18, 2019

Apparently Django's handling of transforms is heavily dependent on version. Closing for now until I have a better understanding of Django's ORM internals.

@aodin aodin closed this Apr 18, 2019
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.

2 participants