summaryrefslogtreecommitdiff
path: root/docs/model-api.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-09-20 01:55:53 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-09-20 01:55:53 +0000
commit94c320d8a982ce30f6dd4e7556f2696229b761c7 (patch)
tree165ff89b8b262118430ea2f7c1d26cc5af864c09 /docs/model-api.txt
parent28a4aa6f49b11881d43a585f118a3d0537ba9084 (diff)
queryset-refactor: Merged to [6381]
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
-rw-r--r--docs/model-api.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt
index 1f0bb60285..a0844ea961 100644
--- a/docs/model-api.txt
+++ b/docs/model-api.txt
@@ -293,6 +293,10 @@ visiting its URL on your site. Don't allow that.
.. _`strftime formatting`: http://docs.python.org/lib/module-time.html#l2h-1941
+**New in development version:** By default, ``FileField`` instances are
+created as ``varchar(100)`` columns in your database. As with other fields, you
+can change the maximum length using the ``max_length`` argument.
+
``FilePathField``
~~~~~~~~~~~~~~~~~
@@ -330,6 +334,10 @@ not the full path. So, this example::
because the ``match`` applies to the base filename (``foo.gif`` and
``bar.gif``).
+**New in development version:** By default, ``FilePathField`` instances are
+created as ``varchar(100)`` columns in your database. As with other fields, you
+can change the maximum length using the ``max_length`` argument.
+
``FloatField``
~~~~~~~~~~~~~~
@@ -361,6 +369,11 @@ Requires the `Python Imaging Library`_.
.. _Python Imaging Library: http://www.pythonware.com/products/pil/
.. _elsewhere: ../db-api/#get-foo-height-and-get-foo-width
+**New in development version:** By default, ``ImageField`` instances are
+created as ``varchar(100)`` columns in your database. As with other fields, you
+can change the maximum length using the ``max_length`` argument.
+
+
``IntegerField``
~~~~~~~~~~~~~~~~
@@ -1284,6 +1297,17 @@ won't add the automatic ``id`` column.
Each model requires exactly one field to have ``primary_key=True``.
+The ``pk`` property
+-------------------
+**New in Django development version**
+
+Regardless of whether you define a primary key field yourself, or let Django
+supply one for you, each model will have a property called ``pk``. It behaves
+like a normal attribute on the model, but is actually an alias for whichever
+attribute is the primary key field for the model. You can read and set this
+value, just as you would for any other attribute, and it will update the
+correct field in the model.
+
Admin options
=============