Similarly, you can return the rows from the cursor as dictionaries using dicts():

    1. stats = (Stat
    2. .select(Stat.url, fn.Count(Stat.url).alias('ct'))
    3. # iterate over a list of 2-tuples containing the url and count