use iterkeys and itervalues from six, or .keys and .values in templates