In django, I have a table of people, each of which has a namefirst and namelast.
I want to do the sql:
select * from names where left(namefirst,1)=left(namelast,1).
Right now my best effort is
qs=People.objects.extra(select={'db':'select left(namefirst,1)=left(namelast,1)'})
but then if i stick a .filter(db=1) on that it generates an error.
I suppose I could order by db and just cut it off, but I know there is a better way to do this.