summaryrefslogtreecommitdiff
path: root/docs/releases/1.0-porting-guide.txt
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-10-06 08:30:02 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-10-06 08:30:02 +0000
commitcddece2db12c28e4f87f7c4d1819461f573d157f (patch)
tree87ad006f2d39223e5eca36e6172603a6382cefa6 /docs/releases/1.0-porting-guide.txt
parent8cbf5d102c43dc27d8728e019a607ca866b73dec (diff)
Fixed #9254 -- Added information to the porting guide about the removal of
"core" and the new methods on model file- and image-fields. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9166 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/releases/1.0-porting-guide.txt')
-rw-r--r--docs/releases/1.0-porting-guide.txt34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/releases/1.0-porting-guide.txt b/docs/releases/1.0-porting-guide.txt
index ba1a918e9a..20721583c3 100644
--- a/docs/releases/1.0-porting-guide.txt
+++ b/docs/releases/1.0-porting-guide.txt
@@ -57,6 +57,15 @@ Remove the ``prepopulated_from`` argument on model fields. It's no longer valid
and has been moved to the ``AdminModel`` class in ``admin.py``. See `the
admin`_, below, for more details about changes to the admin.
+Remove ``core``
+~~~~~~~~~~~~~~~
+
+Remove the ``core`` argument from your model fields. It is no longer
+necessary, since the equivalent functionality (part of :ref:`inline editing
+<admin-inlines>`) is handled differently by the admin interface now. You don't
+have to worry about inline editing until you get to `the admin`_ section,
+below. For now, remove all references to ``core``.
+
Replace ``class Admin:`` with ``admin.py``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -287,6 +296,31 @@ Old (0.96) New (1.0)
``f['content-type']`` ``f.content_type``
===================== =====================
+Work with file fields using the new API
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The internal implementation of :class:`django.db.models.FileField` have changed.
+A visible result of this is that the way you access special attributes (URL,
+filename, image size, etc) of these model fields has changed. You will need to
+make the following changes, assuming your model's
+:class:`~django.db.models.FileField` is called ``myfile``:
+
+=================================== ========================
+Old (0.96) New (1.0)
+=================================== ========================
+``myfile.get_content_filename()`` ``myfile.content.path``
+``myfile.get_content_url()`` ``myfile.content.url``
+``myfile.get_content_size()`` ``myfile.content.size``
+``myfile.save_content_file()`` ``myfile.content.save()``
+``myfile.get_content_width()`` ``myfile.content.width``
+``myfile.get_content_height()`` ``myfile.content.height``
+=================================== ========================
+
+Note that the ``width`` and ``height`` attributes only make sense for
+:class:`~django.db.models.ImageField` fields. More details can be found in the
+:ref:`model API <ref-models-fields>` documentation.
+
+
Templates
---------