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

support having #171

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

support having #171

wants to merge 3 commits into from

Conversation

lyssom
Copy link

@lyssom lyssom commented May 19, 2021

No description provided.

@@ -392,6 +393,9 @@ def as_sql(self):
if self._grouping_with_totals:
sql += ' WITH TOTALS'

if self._having:
sql += '\nhaving ' + self.having_as_sql()
Copy link
Contributor

Choose a reason for hiding this comment

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

it makes sense to use caps i.e. HAVING in order to keep the style

Copy link
Author

Choose a reason for hiding this comment

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

ok,, I change it.

@@ -442,6 +452,14 @@ def order_by(self, *field_names):
qs._order_by = field_names
return qs

def having(self, having_str):
Copy link
Contributor

Choose a reason for hiding this comment

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

what is having_str ?
are you proposing to provide a condition just as a string?
It's a bit changing the concept of ORM, unlike when we do filter there is kwargs approach

Copy link
Author

Choose a reason for hiding this comment

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

I use Q function to support HAVING. Thanks to check it

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