This is something of a reworking of the previously used lambda defined functions that instead of querying for a specific user, now query over a list of users.

The .values postfix returns a Python dict instead of a QuerySet object, meaning that the data has all been loaded from the database, rather than lazy loading (as would actually be efficient with a cached database rather than SQLite).

This function could also be extended to return other kinds of log.