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

Use natural sorting for mapvotes instead of strict alphabetic sorting #6

Open
H-M-H opened this issue Aug 31, 2017 · 4 comments
Open

Comments

@H-M-H
Copy link
Member

H-M-H commented Aug 31, 2017

Replace this line with it then:

for m in Map.objects.filter(server_type=server_type, categories=None).order_by(Lower('name')):

@H-M-H
Copy link
Member Author

H-M-H commented Aug 31, 2017

This should work: https://stackoverflow.com/a/4836734

@heinrich5991
Copy link
Member

Better to do it in the database, I guess: https://stackoverflow.com/a/42535635/870079

@H-M-H
Copy link
Member Author

H-M-H commented Sep 1, 2017

Yes, I would also prefer sorting in the database but the solution proposed implies adding another field to the maps table with all numbers from the mapnames replaced with zeropadded ones. Do we want this ?

@heinrich5991
Copy link
Member

I don't know, I think you're the expert here. :)

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

No branches or pull requests

2 participants