~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/ref/models/fields.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.1.12 upstream) (29.1.1 maverick-security)
  • Revision ID: james.westby@ubuntu.com-20101012113435-yy57c8tx6g9anf3e
Tags: 1.2.3-1ubuntu0.1
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _ref-models-fields:
2
 
 
3
1
=====================
4
2
Model field reference
5
3
=====================
14
12
 
15
13
.. seealso::
16
14
 
17
 
    If the built-in fields don't do the trick, you can easily :ref:`write your
18
 
    own custom model fields <howto-custom-model-fields>`.
 
15
    If the built-in fields don't do the trick, you can easily :doc:`write your
 
16
    own custom model fields </howto/custom-model-fields>`.
19
17
 
20
18
.. note::
21
19
 
293
291
will automatically create it using the field's attribute name, converting
294
292
underscores to spaces. See :ref:`Verbose field names <verbose-field-names>`.
295
293
 
296
 
.. _model-field-types:
297
 
 
298
294
``validators``
299
295
-------------------
300
296
 
302
298
 
303
299
.. attribute:: Field.validators
304
300
 
305
 
A list of validators to run for this field.See the :ref:`validators
306
 
documentation <ref-validators>` for more information.
 
301
A list of validators to run for this field.See the :doc:`validators
 
302
documentation </ref/validators>` for more information.
307
303
 
 
304
.. _model-field-types:
308
305
 
309
306
Field types
310
307
===========
370
367
 
371
368
    If you are writing an application that must be portable to multiple
372
369
    database backends, you should be aware that there are restrictions on
373
 
    ``max_length`` for some backends. Refer to the :ref:`database backend
374
 
    notes <ref-databases>` for details.
 
370
    ``max_length`` for some backends. Refer to the :doc:`database backend
 
371
    notes </ref/databases>` for details.
375
372
 
376
373
.. admonition:: MySQL users
377
374
 
518
515
    .. versionadded:: 1.0
519
516
 
520
517
    Optional. A storage object, which handles the storage and retrieval of your
521
 
    files. See :ref:`topics-files` for details on how to provide this object.
 
518
    files. See :doc:`/topics/files` for details on how to provide this object.
522
519
 
523
520
The admin represents this field as an ``<input type="file">`` (a file-upload
524
521
widget).
553
550
If you want to retrieve the upload file's on-disk filename, or a URL that refers
554
551
to that file, or the file's size, you can use the
555
552
:attr:`~django.core.files.File.name`, :attr:`~django.core.files.File.url`
556
 
and :attr:`~django.core.files.File.size` attributes; see :ref:`topics-files`.
 
553
and :attr:`~django.core.files.File.size` attributes; see :doc:`/topics/files`.
557
554
 
558
555
Note that whenever you deal with uploaded files, you should pay close attention
559
556
to where you're uploading them and what type of files they are, to avoid
903
900
 
904
901
.. attribute:: ForeignKey.limit_choices_to
905
902
 
906
 
    A dictionary of lookup arguments and values (see :ref:`topics-db-queries`)
 
903
    A dictionary of lookup arguments and values (see :doc:`/topics/db/queries`)
907
904
    that limit the available admin choices for this object. Use this with
908
905
    functions from the Python ``datetime`` module to limit choices of objects by
909
906
    date. For example::