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

  • Home
  • SEARCH
  • 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 9119207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:20:28+00:00 2026-06-17T05:20:28+00:00

Hello I am working on a website and have a question why this is

  • 0

Hello I am working on a website and have a question why this is returning the way it is?

I want select distinct ‘category’ from {table}

I tried both with and without Flat = True

In [27]: q = EyeMakeUpWaxing.objects.values_list('category', flat=True).distinct()

In [28]: print q.query
SELECT DISTINCT `eye_make_up_waxing`.`category`, `eye_make_up_waxing`.`created_at` FROM `eye_make_up_waxing` ORDER BY `eye_make_up_waxing`.`created_at` ASC

In [29]: print q
[u'EYE_BEAUTIFICATION', u'EYE_BEAUTIFICATION', u'EYE_BEAUTIFICATION', u'MAKE_UP', u'MAKE_UP', u'MAKE_UP', u'MAKE_UP', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON', u'ENHANCER_ADD_ON']

If this is not the django syntax for this plz help in getting the correct

  • 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-06-17T05:20:29+00:00Added an answer on June 17, 2026 at 5:20 am

    There is an ordering statement in there causing issues (from default ordering defined in your models / somewhere else).

    Clear the ordering via order_by()

    EyeMakeUpWaxing.objects.order_by().values_list('category', flat=True).distinct()
    

    The ordering is forcing a SELECT created_at which makes each of those entries distinct.

    https://docs.djangoproject.com/en/dev/ref/models/querysets/#distinct

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

Sidebar

Related Questions

https://stackoverflow.com/a/64983/468251 - Hello, I have question about this code, how made that working with
Hello Android programmers, I am working on parsing a website in my application. This
Hello I have this list that i am working on. When i move the
Hello I have a site I am working on an for this site I
I have an asp.net3.5 website.want to deploy this site on iis.After deploy my default
Hello I am working on wireless sensor network (Zigbee). WSN gateway device have a
Hello all I am working on javascript jquery and svg.I want to ask a
hello all i am working on a project in which i have a webpage
Hello all I am working in javascript and html5.I want to ask that how
I am working through the mapping plugin example on the Knockoutjs website. This is

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.