-
Notifications
You must be signed in to change notification settings - Fork 54
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
Updates to portfolio summary #4862
Conversation
else: | ||
target = "" | ||
|
||
related_model = Case(When(**{column_name: target}, then=Value(1)), default=Value(0), output_field=IntegerField()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By defautt, django .order_by(...)
will put blank values above "A" values.
- asc: None, "A", "B", "Z"
- desc: "Z", "B", "A", None
I thought this was counterintuitive. If a user sorted a text column like historical notes, "A" should be at the top, and blanks should be below "Z". If this doesn't matter, I can simplify this function by removing the related_model
annotation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the way you implemented it!
else: | ||
target = "" | ||
|
||
related_model = Case(When(**{column_name: target}, then=Value(1)), default=Value(0), output_field=IntegerField()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the way you implemented it!
Any background context you want to provide?
The following is based on user feedback.
What's this PR do?
goal_note
andhistorical_note
).How should this be manually tested?
What are the relevant tickets?
#4852
#4583
Screenshots (if appropriate)