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

Adding missing GroupConcat features issue #1101 #1111

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

smilerightnow
Copy link

Hello, I added the missing feature of issue #1101. Now it's ordering by multiple columns.

I also added two tests, all the tests are green.

Copy link
Owner

@adamchainz adamchainz left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the initial work here.

I think we should make these changes:

  1. Don't add a new ordering parameter. Instead, let's update ordering to accept a sequence (list or tuple) of strings representing field names. Then users can specify e.g. ordering=("name",) to order by the name column.
  2. Use field names instead of column names, like QuerySet.order_by. You then need to use the model field to map to the column name, and escape the column name with the internal function connection.ops.quote_name.
  3. Don't use "asc"/"desc" terminology with field names. Instead, default to asc ordering and support a - prefix for desc ordering, like QuerySet.order_by.
  4. Update the docs.
  5. Add a changelog note.

Thanks!

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