Django query to get a unique set based on a particular column's value
- by kchau
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...