With the other one, you would have got [u'ACTIVE', u'RESIGNED', u'TRANSFER'] without the unnecessary 'status' keyword each time. Here you got only 3 results, but with more number of results, the 'status' keyword each time would look annoying to me atleast.
But, I'm not sure which one will be faster. Can anyone please let me know, which one would be faster. I'm not much considered about memory usage. Thanks, Subhranath Chunder. On Thu, Jul 22, 2010 at 12:42 AM, rmschne <rmsc...@gmail.com> wrote: > statuscodes=Member.objects.values('status').order_by('status').distinct() > > It gives me the expected results. Three items in the dictionary from > a database table of about 10,000 records: > [{'status': u'ACTIVE'}, {'status': u'RESIGNED'}, {'status': > u'TRANSFER'}] > > it's what i both expected and want. > > On Jul 21, 7:33 pm, Subhranath Chunder <subhran...@gmail.com> wrote: > > I thought you were trying to get: > > > > I'm expecting only the four distinct records. > > > > You'll get a ValuesQuerySet or list of dictionaries with redundant keys > this > > way. > > > > Thanks, > > Subhranath Chunder. > > > > > > > > On Wed, Jul 21, 2010 at 11:40 PM, rmschne <rmsc...@gmail.com> wrote: > > > Member.objects.values('status').order_by('status').distinct() from > > > jaymzcd works perfectly. Thanks! > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Django users" group. > > > To post to this group, send email to django-us...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > <django-users%2bunsubscr...@google groups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/django-users?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.