Skip to content

Conversation

@henadzit
Copy link
Contributor

@henadzit henadzit commented Nov 10, 2024

Description

  • Returns joins from arithmetic expressions (CombinedExpression) which allows to have queries like Author.annotate(rating=Avg(F("books__rating") + 1))
  • Moves TestQueryReuse tests to a separate file. I found it to be quite inconvenient to have them in test_queryset, I added a few unrelated tests to TestQueryReuse by mistake.

Motivation and Context

This should fix #996.

How Has This Been Tested?

  • Added tests

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

exp_cls = MultipleObjectsReturned


class TestQueryReuse(test.TestCase):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to test_queryset_reuse.py

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11766677963

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.162%

Totals Coverage Status
Change from base Build 11764062074: 0.0%
Covered Lines: 6084
Relevant Lines: 6709

💛 - Coveralls

@abondar abondar merged commit b75ca5f into tortoise:develop Nov 14, 2024
7 checks passed
@abondar
Copy link
Member

abondar commented Nov 14, 2024

@henadzit Thank you!

If you are by any chance willing to be part of tortoise and help me maintain it - I would be happy to invite you.
If so - please contact me at [email protected]

P.S. Do I understand correctly that you are russian-speaking? :)

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.

Function cannot use relations in the scope of annotate

3 participants