Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.0.X] Fixed #9254 -- Added information to the porting guide about t…

…he removal

of "core" and the new methods on model file- and image-fields.

Backport of r9166 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 282c38d4067d8604c37d70c1827b4244c9e53b18 1 parent 51fb4bb
Malcolm Tredinnick authored October 06, 2008

Showing 1 changed file with 34 additions and 0 deletions. Show diff stats Hide diff stats

  1. 34  docs/releases/1.0-porting-guide.txt
34  docs/releases/1.0-porting-guide.txt
@@ -57,6 +57,15 @@ Remove the ``prepopulated_from`` argument on model fields. It's no longer valid
57 57
 and has been moved to the ``AdminModel`` class in ``admin.py``. See `the
58 58
 admin`_, below, for more details about changes to the admin.
59 59
 
  60
+Remove ``core``
  61
+~~~~~~~~~~~~~~~
  62
+
  63
+Remove the ``core`` argument from your model fields. It is no longer
  64
+necessary, since the equivalent functionality (part of :ref:`inline editing
  65
+<admin-inlines>`) is handled differently by the admin interface now. You don't
  66
+have to worry about inline editing until you get to `the admin`_ section,
  67
+below. For now, remove all references to ``core``.
  68
+
60 69
 Replace ``class Admin:`` with ``admin.py``
61 70
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62 71
 
@@ -287,6 +296,31 @@ Old (0.96)            New (1.0)
287 296
 ``f['content-type']`` ``f.content_type``
288 297
 ===================== =====================
289 298
 
  299
+Work with file fields using the new API
  300
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  301
+
  302
+The internal implementation of :class:`django.db.models.FileField` have changed.
  303
+A visible result of this is that the way you access special attributes (URL,
  304
+filename, image size, etc) of these model fields has changed. You will need to
  305
+make the following changes, assuming your model's
  306
+:class:`~django.db.models.FileField` is called ``myfile``:
  307
+
  308
+=================================== ========================
  309
+Old (0.96)                           New (1.0)
  310
+=================================== ========================
  311
+``myfile.get_content_filename()``   ``myfile.content.path``
  312
+``myfile.get_content_url()``        ``myfile.content.url``
  313
+``myfile.get_content_size()``       ``myfile.content.size``
  314
+``myfile.save_content_file()``      ``myfile.content.save()``
  315
+``myfile.get_content_width()``      ``myfile.content.width``
  316
+``myfile.get_content_height()``     ``myfile.content.height``
  317
+=================================== ========================
  318
+
  319
+Note that the ``width`` and ``height`` attributes only make sense for
  320
+:class:`~django.db.models.ImageField` fields. More details can be found in the
  321
+:ref:`model API <ref-models-fields>` documentation.
  322
+
  323
+
290 324
 Templates
291 325
 ---------
292 326
 

0 notes on commit 282c38d

Please sign in to comment.
Something went wrong with that request. Please try again.