| | 506 | |
| | 507 | == Changed behavior of MultiValueDict.items() == |
| | 508 | |
| | 509 | In [1504], the {{{MultiValueDict}}} (and {{{QueryDict}}}) {{{items()}}} method was changed to return the *last* member of each list rather than the full list. |
| | 510 | |
| | 511 | This probably doesn't affect anybody, but it's listed here for completeness. |
| | 512 | |
| | 513 | Old behavior: |
| | 514 | {{{ |
| | 515 | >>> q = QueryDict('a=1&a=2') |
| | 516 | >>> q.items() |
| | 517 | [('a', ['1', 2'])] |
| | 518 | }}} |
| | 519 | |
| | 520 | New behavior: |
| | 521 | {{{ |
| | 522 | >>> q = QueryDict('a=1&a=2') |
| | 523 | >>> q.items() |
| | 524 | [('a', '2')] |
| | 525 | }}} |
| | 526 | |
| | 527 | To emulate the old behavior, use the new {{{lists()}}} method: |
| | 528 | |
| | 529 | {{{ |
| | 530 | >>> q = QueryDict('a=1&a=2') |
| | 531 | >>> q.lists() |
| | 532 | [('a', ['1', 2'])] |
| | 533 | }}} |