I'm struggling getting my head around the Django's ORM. What I want to do is get a list of distinct values within a field on my table .... the equivalent of one of the following:
SELECT DISTINCT myfieldname FROM mytable
(or alternatively)
SELECT myfieldname FROM mytable GROUP BY myfieldname
I'd at least like to do it the Django way before resorting to raw sql. For example, with a table:
id, street, city
1, Main Street, Hull
2, Other Street, Hull
3, Bibble Way, Leicester
4, Another Way, Leicester
5, High Street, Londidium
I'd like to get:
Hull, Leicester, Londidium.