Changes between Version 114 and Version 115 of BackwardsIncompatibleChanges

08/06/2007 09:21:43 AM (11 years ago)
Russell Keith-Magee

Added note on changes to newforms caused by introduction of File and Image fields


  • BackwardsIncompatibleChanges

    v114 v115  
    3232 * [5752] July 23, 2007: [ Added `interactive` argument to `run_tests`]
    3333 * [5769] July 28, 2007: [ Changed format for first argument to `run_tests` ]
     34 * [5819] August 6, 2007: [ Minor change to newforms arguments and data dictionary handling ]
    3536== Database constraint names changed ==
    267268This change has no effect on most end users. However, it does require a significant change to the prototype of run_test, which will be backwards incompatible for anyone with a customized test runner. Previously, the first argument to `run_tests` was a list of application modules. These modules would then be searched for test cases. After [5769], the first argument to `run_tests` is a list of test labels. Whereas run_tests was previously given a list of already-loaded applications, it is now the responsibility of the test runner to load the appropriate applications. Anyone with a customized test runner will need to incorporate the appropriate calls to `get_app()` as part of their test runner.
     270== Minor change to newforms arguments and data dictionary handling ==
     272In [5819], `FileField` and `ImageField` were added to newforms. Implementing these fields required some subtle changes to the way data binding occurs in newforms.
     274This change will have no effect on most end users. The simple cases for binding forms do not change. However:
     276 * The second argument to a form instance is now taken by file data. As a result, if you implicitly relied upon the order of the keyword arguments `auto_id`, `prefix` and `initial` when instantiating forms, your forms will no longer interpret these options correctly. To overcome this problem, explicitly name these keyword arguments - for example, use:
     279f = ContactForm(data, auto_id=True)
     282rather than:
     285f = ContactForm(data, True)
     288 * A `files` argument was added to the prototype for `value_from_datadict()` to allow for the processing of file data. If you have written any custom widgets that provide their own data dictionary handling, you will need to modify those widgets to accomodate the new argument. If your custom widget has no need to handle file data, all you will need to do is change the method definition from:
     291def value_from_datadict(self, data, name):
     297def value_from_datadict(self, data, files, name):
Back to Top