Code

Changes between Version 254 and Version 255 of BackwardsIncompatibleChanges


Ignore:
Timestamp:
08/27/08 01:11:40 (6 years ago)
Author:
mtredinnick
Comment:

Added note about [8618][

Legend:

Unmodified
Added
Removed
Modified
  • BackwardsIncompatibleChanges

    v254 v255  
    12541254 * Removed `django.core.validators`: 
    12551255   * Moved `ValidationError` exception to `django.core.exceptions`. 
     1256 
     1257== ModelForms made more like Forms == 
     1258 
     1259This is a very subtle change that will only affect people accessing formfields as attributes on a `ModelForm`. After [8618], this is no longer possible. It has never been possible on a `Form` class and was an oversight for `ModelForm`. For most people, no change is required and templates will work exactly as they did before. 
     1260 
     1261The code change for those affected is 
     1262{{{ 
     1263#!python 
     1264 
     1265class MyForm(forms.ModelForm): 
     1266   foo = forms.CharField(...) 
     1267 
     1268myform = MyForm() 
     1269 
     1270# Bad. Don't do this. 
     1271myform.foo         # Previously possible on ModelForms, but only worked by accident. 
     1272 
     1273# Good! 
     1274myform['foo']      # Has always worked. Works for Forms and ModelForms. 
     1275}}}