django equivalent of select count(distinct foo) snippet