Changes between Version 180 and Version 181 of BackwardsIncompatibleChanges
- Timestamp:
- Jul 7, 2008, 6:27:07 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BackwardsIncompatibleChanges
v180 v181 60 60 * [7799] June 30, 2008 [#BooleanFieldsinnewformsenforcerequired BooleanFields in newforms enforce "required"] 61 61 * [7806] June 30, 2008 [#DefaultUserorderingremoved Default User ordering removed] 62 * [7814] July 1, 2008 [#Uploadedfilechanges Uploaded file changes]62 * [7814] July 1, 2008 & [7859] [#Uploadedfilechanges Uploaded file changes] 63 63 * [7844] July 6, 2008 [#Translationtoolsnowpartofdjango-admin.py Translation tools now part of `django-admin.py`] 64 * [7859] July 7, 2008 [#Uploadedfilechanges More uploaded file changes]. 64 65 65 66 == Database constraint names changed == … … 637 638 However, as part of the change, the representation of uploaded files has changed. Previous, uploaded files -- that is, entries in {{{request.FILES}}} -- were represented by simple dictionaries with a few well-known keys. Uploaded files are now represented by an [http://www.djangoproject.com/documentation/upload_handling/#uploaded-file-objects UploadedFile object], and thus the file's information is accessible through object attributes. Thus, given {{{f = request.FILES['some_field_name']}}}: 638 639 639 || ''' Old''' || '''New'''||640 || {{{f['content']}}} || {{{f.read()}}}||641 || {{{f['filename']}}} || {{{f.file_name}}}||642 || {{{f['content-type']}}} || {{{f.content_type}}}||640 || '''Deprecated''' || '''Replacement''' || 641 || {{{f['content']}}} || {{{f.read()}}} || 642 || {{{f['filename']}}} || {{{f.name}}} || 643 || {{{f['content-type']}}} || {{{f.content_type}}} || 643 644 644 645 The old dictionary-style key access is still supported, but will raise a {{{DeprecationWarning}}}. 646 647 [7859] further cleaned up and clarified this interface. It unfortunatly had to deprecate a couple of things added in [7814]: 648 649 || '''Deprecated''' || '''Replacement''' || 650 || {{{f.file_name}}} || {{{f.name}}} || 651 || {{{f.file_size}}} || {{{f.size}}} || 652 || {{{f.chunk()}}} || {{{f.chunks()}}} (note the plural) || 653 654 The old attributes will still work, but will issue deprecation warnings. 655 656 Finally, [7859] removed the {{{django.newforms.fields.UploadedFile}}} class, unifying the use of {{{django.core.files.uploadedfile.UploadedFile}}} everywhere in Django. This means a few API changes when using a form with a {{{FileField}}}. 657 658 || '''Deprecated''' || '''Replacement''' || 659 || {{{form.cleaned_data['file_field'].filename}}} || {{{form.cleaned_data['file_field'].name}}} || 660 || {{{form.cleaned_data['file_field'].data}}} || {{{form.cleaned_data['file_field'].read()}}} || 645 661 646 662 == Translation tools now part of `django-admin.py` ==