@staticmethod
def dict_factory(cursor, old_row):
    """
        Dictionary factory for return results with dictionaries.

        :param sqlite3.Cursor cursor: The cursor.
        :param list old_row: A row from the result a a query.

        :rtype: dict
        """
    new_row = {}
    for index, col in enumerate(cursor.description):
        new_row[col[0]] = old_row[index]
    return new_row
