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 film manager to sort titles #118

Merged
merged 2 commits into from
Sep 30, 2024
Merged

Conversation

acholyn
Copy link
Collaborator

@acholyn acholyn commented Sep 24, 2024

closes #116

should follow alphabetical order of the films:
Numbers come first.
Then films are listed by the first letter of their title, but by the second if the first word is A or The.

@acholyn acholyn requested a review from tcouch September 24, 2024 09:51
Copy link
Collaborator

@tcouch tcouch left a comment

Choose a reason for hiding this comment

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

Looks like it works, but I don't think you need to worry about the is_number bit.

.get_queryset()
.annotate(
# new field 'is_number' to check if the title starts with a number
is_number=Case(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't numbers always come first in alphabetical ordering anyway?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah fair enough, I hadn't been sure about that

@acholyn acholyn merged commit 8855008 into development Sep 30, 2024
3 checks passed
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.

sort films
2 participants