diff options
| author | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-06-11 15:53:42 +0000 |
|---|---|---|
| committer | Boulder Sprinters <boulder-sprinters@djangoproject.com> | 2007-06-11 15:53:42 +0000 |
| commit | 0f36cbec13a2a6792036b16a7596ad024592309c (patch) | |
| tree | fcef9d122cb854537186db0e8934219b6ba59764 /docs/model-api.txt | |
| parent | 5e8eef19dc78baeaed7d324e1767e8bf2b2bc387 (diff) | |
boulder-oracle-sprint: Merged to [5462]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5463 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
| -rw-r--r-- | docs/model-api.txt | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt index de765f3517..2794046ebd 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -447,6 +447,11 @@ and doesn't give a 404 response). The admin represents this as an ``<input type="text">`` (a single-line input). +``URLField`` takes an optional argument, ``maxlength``, the maximum length (in +characters) of the field. The maxlength is enforced at the database level and +in Django's validation. If you don't specify ``maxlength``, a default of 200 +is used. + ``USStateField`` ~~~~~~~~~~~~~~~~ @@ -1877,14 +1882,15 @@ rows. Example:: row = cursor.fetchone() return row -``connection`` and ``cursor`` simply use the standard `Python DB-API`_. If -you're not familiar with the Python DB-API, note that the SQL statement in -``cursor.execute()`` uses placeholders, ``"%s"``, rather than adding parameters -directly within the SQL. If you use this technique, the underlying database -library will automatically add quotes and escaping to your parameter(s) as -necessary. (Also note that Django expects the ``"%s"`` placeholder, *not* the -``"?"`` placeholder, which is used by the SQLite Python bindings. This is for -the sake of consistency and sanity.) +``connection`` and ``cursor`` mostly implement the standard `Python DB-API`_ +(except when it comes to `transaction handling`_). If you're not familiar with +the Python DB-API, note that the SQL statement in ``cursor.execute()`` uses +placeholders, ``"%s"``, rather than adding parameters directly within the SQL. +If you use this technique, the underlying database library will automatically +add quotes and escaping to your parameter(s) as necessary. (Also note that +Django expects the ``"%s"`` placeholder, *not* the ``"?"`` placeholder, which is +used by the SQLite Python bindings. This is for the sake of consistency and +sanity.) A final note: If all you want to do is a custom ``WHERE`` clause, you can just just the ``where``, ``tables`` and ``params`` arguments to the standard lookup @@ -1892,6 +1898,7 @@ API. See `Other lookup options`_. .. _Python DB-API: http://www.python.org/peps/pep-0249.html .. _Other lookup options: ../db-api/#extra-params-select-where-tables +.. _transaction handling: ../transactions/ Overriding default model methods -------------------------------- |
