Changes between Version 55 and Version 56 of BackwardsIncompatibleChanges


Ignore:
Timestamp:
Nov 29, 2005, 10:22:34 PM (18 years ago)
Author:
Adrian Holovaty
Comment:

Added "Changed behavior of MultiValueDict.items()" section

Legend:

Unmodified
Added
Removed
Modified
  • BackwardsIncompatibleChanges

    v55 v56  
    504504
    505505 * On the off chance you have legacy URLconfs that have NO captured items but DO use capturing parenthesis (which until now would have had no effect), you'll need to either change your view code to accept the captured values, or uncapture them.
     506
     507== Changed behavior of MultiValueDict.items() ==
     508
     509In [1504], the {{{MultiValueDict}}} (and {{{QueryDict}}}) {{{items()}}} method was changed to return the *last* member of each list rather than the full list.
     510
     511This probably doesn't affect anybody, but it's listed here for completeness.
     512
     513Old behavior:
     514{{{
     515>>> q = QueryDict('a=1&a=2')
     516>>> q.items()
     517[('a', ['1', 2'])]
     518}}}
     519
     520New behavior:
     521{{{
     522>>> q = QueryDict('a=1&a=2')
     523>>> q.items()
     524[('a', '2')]
     525}}}
     526
     527To 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}}}
Back to Top