Changes between Version 259 and Version 260 of BackwardsIncompatibleChanges

08/31/2008 10:12:11 PM (11 years ago)
Malcolm Tredinnick

reverse() no longer takes bonus, unused arguments


  • BackwardsIncompatibleChanges

    v259 v260  
    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).
     1291== reverse() and url template tag no longer accept extra arguments ==
     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).
     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