-
Notifications
You must be signed in to change notification settings - Fork 6
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
Ks 2022 09 proposals random sorting #4475
Conversation
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.
working fine!
the preserved
variable is hard to read for me, but its my inexperience :) Leaving for @fuzzylogic2000 to doublecheck!
if ordering: | ||
if ordering == ['-daily_random']: | ||
pks = list(queryset.values_list('pk', flat=True)) | ||
random.seed(str(date.today())) |
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.
nice!
b477814
to
6d078b8
Compare
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.
Nice! Also, more testing. :)
6d078b8
to
b13d64c
Compare
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.
It looks good, but it seems like the newest filter breaks with that? (Fine on dev, but different to the second list locally.) Will investigate more later!
@@ -85,12 +85,13 @@ def list(self, request, *args, **kwargs): | |||
ordering_choices = [('-created', _('Most recent')), ] | |||
if self.module.has_feature('rate', Proposal): | |||
ordering_choices += ('-positive_rating_count', _('Most popular')), | |||
ordering_choices += ('-comment_count', _('Most commented')), | |||
ordering_choices += ('-comment_count', _('Most commented')), \ | |||
('-daily_random', _('Random')), |
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.
Why the -? It probably doesn't matter if we use the random ascending or descending.
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.
It is all fine looking at it again. And also it doesn't make sense that the code shouldn't work like before.
The random stuff is copied from here. Im a bit unhappy with doubling everything, but did not know how else to do it in a good way?
ToDo: