Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:56:00+00:00 2026-05-26T11:56:00+00:00

A little background about our specific problem -> We are trying to build a

  • 0

A little background about our specific problem ->

We are trying to build a Q & A site, much like Stackoverflow.
People can come and ask questions and other people reply.

So like SO (https://stackoverflow.com/questions) we have a questions page. Now the problem we’re having is that we have this model :

class Questions(models.Models):   
    user = person
    question = CharField   
    number_of_replies = IntegerField  
    datetime = DateTime

The resultant queryset ( or list ) is determined by a combination of various factors like when it was posted, how many people replied to it, etc.

Since there’s been confusion related to the question i’ll clarify it ->
This is the kind of output I’m looking for :

This is how the final order will be ->

  1. Question c posted 10 mins ago, 0 replies
  2. Question f posted 1 min ago, 2 replies
  3. Question b posted 5 mins ago, 1 reply
    etc.
    so there is no one-dimensional order, the order is a function of various parameters
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:56:00+00:00Added an answer on May 26, 2026 at 11:56 am

    One way of doing it is by defining a custom manager ->

    https://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-model-inheritance.

    You can display the objects in any order you like. You can even return lists and self-defined dictionaries using the custom manager methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, a little background. I have strings that resemble the following: ((Foo.Bar.StartsWith(A)) && (Foo.Bar.EndsWith(B)))
First a little background about why I'm asking this question... I'm working on a
A little background on the application that I am gonna talk about in the
Okay, to give a little background, I learned WPF about 3 years ago and
First, a little background. Currently namespaces and assemblies in our codebase (~60 assemblies, thousands
I am working on this site: http://www.problemio.com and I have very little clue about
A little background: I'm creating a set of adapters to allow communication with mobile
A little background: I am loading a WPF UI from a database which is
A little background first. I've been tasked with encrypting files with a Powershell script
A little background first: I'm a designer/developer and decided to use subversion for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.