Changes between Version 259 and Version 260 of BackwardsIncompatibleChanges


Ignore:
Timestamp:
Aug 31, 2008, 10:12:11 PM (16 years ago)
Author:
Malcolm Tredinnick
Comment:

reverse() no longer takes bonus, unused arguments

Legend:

Unmodified
Added
Removed
Modified
  • BackwardsIncompatibleChanges

    v259 v260  
    12881288
    12891289For most people, this change will have no effect. It is only relevant if you are using custom primary key attributes and relying on the old behaviour as a way of keeping the data up to date if older values previously existed. You will now have to emulate that old behaviour manually (by calling `save()` on the model instance).
     1290
     1291== reverse() and url template tag no longer accept extra arguments ==
     1292
     1293In [8760] `django.core.urlresolvers.reverse()` and the `{% url .. %}` template tag had an internals rewrite. This fixed a number of niggling bugs where certain common patterns couldn't be reversed. This includes allowing optional portions in the patterns that can be reversed (including optional arguments).
     1294
     1295A side-effect of this is that you can no longer give extra arguments to the function or the tag beyond what should match the pattern for the name you have given. So if your pattern expects two argument and you give it three, no match will occur. Similarly if it expects arguments called `foo` and `bar` and you also provide a dictionary containing `baz`, no match will occur. This is because ''another'' pattern might accept `foo`, `bar` ''and'' `baz` and we don't want the first pattern to match by accident.
Back to Top