Code

Changes between Version 114 and Version 115 of BackwardsIncompatibleChanges


Ignore:
Timestamp:
08/06/07 07:21:43 (7 years ago)
Author:
russellm
Comment:

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

Legend:

Unmodified
Added
Removed
Modified
  • BackwardsIncompatibleChanges

    v114 v115  
    3232 * [5752] July 23, 2007: [http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Addedinteractiveargumenttorun_tests Added `interactive` argument to `run_tests`] 
    3333 * [5769] July 28, 2007: [http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Changedformatforfirstargumenttorun_tests Changed format for first argument to `run_tests` ] 
     34 * [5819] August 6, 2007: [http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Minorchangetonewformsargumentsanddatadictionaryhandling Minor change to newforms arguments and data dictionary handling ] 
    3435 
    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. 
    268269 
     270== Minor change to newforms arguments and data dictionary handling == 
     271 
     272In [5819], `FileField` and `ImageField` were added to newforms. Implementing these fields required some subtle changes to the way data binding occurs in newforms.  
     273 
     274This change will have no effect on most end users. The simple cases for binding forms do not change. However: 
     275 
     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: 
     277 
     278{{{ 
     279f = ContactForm(data, auto_id=True) 
     280}}} 
     281 
     282rather than: 
     283 
     284{{{ 
     285f = ContactForm(data, True) 
     286}}} 
     287 
     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: 
     289 
     290{{{ 
     291def value_from_datadict(self, data, name): 
     292}}} 
     293 
     294to: 
     295 
     296{{{ 
     297def value_from_datadict(self, data, files, name): 
     298}}} 
     299