divanov11 / mumbleapi

Backend/API for the Mumble.dev, an open source social media application.
Apache License 2.0
199 stars 122 forks source link

Ordering mumbles by date and vote_rank #141

Closed lawliet-cpp closed 3 years ago

lawliet-cpp commented 3 years ago

A clear and concise description of what the problem is.

The mumbles are ordered by date only a better way is to order them by upvotes too

in the feed app views.py line 31 we have this mumbles = Mumble.objects.filter(parent=None, useridin=ids) accoreding to the Meta class of the Mumble model the mumbles are ordered by the creation date

# Solution

a better way is to order them by both date and vote_rank so the line 31 of the views.py will become like this

mumbles = Mumble.objects.filter(parent=None, useridin=ids).order_by("-created", "vote_rank")

lawliet-cpp commented 3 years ago

I want to work on this

PraveenMalethia commented 3 years ago

Also please add this ordering in the article and discussion app!

lawliet-cpp commented 3 years ago

Also please add this ordering in the article and discussion app!

Okey i'll handle this

lawliet-cpp commented 3 years ago

Also please add this ordering in the article and discussion app!

to do this i need to add the vote_rank field to the article and discussion models and then add the upvote and downvote functionality i think that i will put this in another enchacement feature