Django query to get a unique set based on a particular column's value

Posted by kchau on Stack Overflow See other posts from Stack Overflow or by kchau
Published on 2010-03-26T20:15:34Z Indexed on 2010/03/26 20:23 UTC
Read the original article Hit count: 332

Filed under:
|
|

Hope this makes sense...

Is there a simple way to return a set of values from a table based on a single column's values being distinctly unique? What I'm hoping for is something like:

SegCode.query.filter(ref.unique()).only('ref')

That's not real code, but I was hoping there was some simple function out there that will accomplish this...

© Stack Overflow or respective owner

Related posts about django

Related posts about django-queryset