Fixing get_previous_and_next to match django 1.6