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

Fix Query class to permit subclass creation #270

merged 2 commits into from Jul 3, 2019


Copy link

othalan commented Jun 27, 2019

Creating a subclass of the Query class in order to implement custom queries currently fails because the getattr method creates a new instance of the Query class using a hard-coded name rather than the type of the current instance. This can easily be fixed by using type(self)() to create the new class instance.

Creating a new subclass of Query is useful in order to simplify code scenarios where custom test functions are frequently used.

This pull request provides both a test and a fix for this problem.


This comment has been minimized.

Copy link
Contributor Author

othalan commented Jun 28, 2019

The checks seem to be failing because of errors communicating with coveralls, not because of any issue with this change.

@msiemens msiemens merged commit f3b18d2 into msiemens:master Jul 3, 2019
1 check failed
1 check failed
TinyDB Build #20190628.1 failed

This comment has been minimized.

Copy link

msiemens commented Jul 3, 2019

That's a good idea, thanks @othalan 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.