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

Added RANDOM as dummy field for random order in queries #60

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

Conversation

adapar
Copy link

@adapar adapar commented Mar 7, 2018

I recently needed to use a random ordering of query results. To avoid the call to databaseColumn with a non-existing field I added a special case for using RANDOM as a field name and adding the RANDOM() call to the query.

@jlaine
Copy link
Owner

jlaine commented Mar 7, 2018

I am not against adding random ordering but I would prefer if we adhere to Django's conventions whenever possible.

https://docs.djangoproject.com/en/2.0/ref/models/querysets/#order-by

Django uses a question mark to denote random ordering, could you do the same please?

Also can you please add a unit test and mention this special column name in the docs for order_by?

@adapar
Copy link
Author

adapar commented Mar 8, 2018

Ok, no problem.

@jlaine
Copy link
Owner

jlaine commented Apr 4, 2018

Any progress on the requested change + tests?

@adapar
Copy link
Author

adapar commented Apr 4, 2018 via email

@jlaine
Copy link
Owner

jlaine commented Sep 8, 2018

ping?

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