(historyentries)
return {x["date"].date(): x["count"] for x in listeners}
returns {date: play-count} containing all days w/ play events
returns {date: play-count} containing all days w/ play events
returns { date : play - count } containing all days w / play events
def playcounts_timerange(historyentries):
    """returns {date: play-count} containing all days w/ play events"""
    listeners = (
        historyentries.extra({"date": "date_trunc('day', timestamp)"})
        .values("date")
        .order_by("date")
        .annotate(count=Count("pk"))
    )

    return {x["date"].date(): x["count"] for x in listeners}
def playcounts_timerange ( historyentries ) : listeners = ( historyentries . extra ( { "date" : "date_trunc('day', timestamp)" } ) . values ( "date" ) . order_by ( "date" ) . annotate ( count = Count ( "pk" ) ) ) return { x [ "date" ] . date ( ) : x [ "count" ] for x in listeners }