From 22e160945a38f82c7e30f7137b3fcac9dd778fba Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 25 Aug 2007 23:31:05 +0000 Subject: newforms-admin: Merged to [6013] git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6014 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/add_ons.txt | 23 +++++++++++++++ docs/db-api.txt | 19 +++++++++---- docs/django-admin.txt | 21 +++++++++++--- docs/faq.txt | 4 --- docs/model-api.txt | 2 +- docs/newforms.txt | 78 +++++++++++++++++++++++++++++++++++++-------------- docs/settings.txt | 9 +++--- docs/testing.txt | 2 +- docs/tutorial01.txt | 33 ++++++++++++++++++++++ 9 files changed, 151 insertions(+), 40 deletions(-) (limited to 'docs') diff --git a/docs/add_ons.txt b/docs/add_ons.txt index 8682208970..a1d78b8685 100644 --- a/docs/add_ons.txt +++ b/docs/add_ons.txt @@ -138,6 +138,29 @@ Examples: You can pass in either an integer or a string representation of an integer. +naturalday +---------- + +**New in Django development version** + +For dates that are the current day or within one day, return "today", +"tomorrow" or "yesterday", as appropriate. Otherwise, format the date using +the passed in format string. + +**Argument:** Date formatting string as described in default tag now_. + +.. _now: ../templates/#now + +Examples (when 'today' is 17 Feb 2007): + + * ``16 Feb 2007`` becomes ``yesterday``. + * ``17 Feb 2007`` becomes ``today``. + * ``18 Feb 2007`` becomes ``tomorrow``. + * Any other day is formatted according to given argument or the + `DATE_FORMAT`_ setting if no argument is given. + +.. _DATE_FORMAT: ../settings/#date_format + flatpages ========= diff --git a/docs/db-api.txt b/docs/db-api.txt index 766a6ae519..3198f335c4 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -207,14 +207,23 @@ the database until you explicitly call ``save()``. The ``save()`` method has no return value. -Updating ``ForeignKey`` fields works exactly the same way; simply assign an -object of the right type to the field in question:: +Saving ForeignKey and ManyToManyField fields +-------------------------------------------- + +Updating ``ForeignKey`` fields works exactly the same way as saving a normal +field; simply assign an object of the right type to the field in question:: + + cheese_blog = Blog.objects.get(name="Cheddar Talk") + entry.blog = cheese_blog + entry.save() + +Updating a ``ManyToManyField`` works a little differently; use the ``add()`` +method on the field to add a record to the relation:: joe = Author.objects.create(name="Joe") - entry.author = joe - entry.save() + entry.authors.add(joe) -Django will complain if you try to assign an object of the wrong type. +Django will complain if you try to assign or add an object of the wrong type. How Django knows to UPDATE vs. INSERT ------------------------------------- diff --git a/docs/django-admin.txt b/docs/django-admin.txt index aea990c5dc..366483a47a 100644 --- a/docs/django-admin.txt +++ b/docs/django-admin.txt @@ -124,6 +124,13 @@ executed. This means that all data will be removed from the database, any post-synchronization handlers will be re-executed, and the ``initial_data`` fixture will be re-installed. +The behavior of this command has changed in the Django development version. +Previously, this command cleared *every* table in the database, including any +table that Django didn't know about (i.e., tables that didn't have associated +models and/or weren't in ``INSTALLED_APPS``). Now, the command only clears +tables that are represented by Django models and are activated in +``INSTALLED_APPS``. + inspectdb --------- @@ -240,6 +247,7 @@ Executes the equivalent of ``sqlreset`` for the given appnames. runfcgi [options] ----------------- + Starts a set of FastCGI processes suitable for use with any web server which supports the FastCGI protocol. See the `FastCGI deployment documentation`_ for details. Requires the Python FastCGI module from @@ -337,7 +345,7 @@ Refer to the description of ``sqlcustom`` for an explanation of how to specify initial data. sqlclear [appname appname ...] --------------------------------------- +------------------------------ Prints the DROP TABLE SQL statements for the given appnames. @@ -360,18 +368,23 @@ table modifications, or insert any SQL functions into the database. Note that the order in which the SQL files are processed is undefined. +sqlflush +-------- + +Prints the SQL statements that would be executed for the `flush`_ command. + sqlindexes [appname appname ...] ----------------------------------------- +-------------------------------- Prints the CREATE INDEX SQL statements for the given appnames. sqlreset [appname appname ...] --------------------------------------- +------------------------------ Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given appnames. sqlsequencereset [appname appname ...] ----------------------------------------------- +-------------------------------------- Prints the SQL statements for resetting sequences for the given appnames. diff --git a/docs/faq.txt b/docs/faq.txt index 844ea77809..cef0508562 100644 --- a/docs/faq.txt +++ b/docs/faq.txt @@ -204,10 +204,6 @@ out a few points, we want to make sure they reflect the final state of things at Django 1.0, not some intermediary step. In other words, we don't want to spend a lot of energy creating screencasts yet, because Django APIs will shift. -In the meantime, though, check out this `unofficial Django screencast`_. - -.. _unofficial Django screencast: http://www.throwingbeans.org/django_screencasts.html - Is Django a content-management-system (CMS)? -------------------------------------------- diff --git a/docs/model-api.txt b/docs/model-api.txt index 0f872c3097..7dac54992f 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -344,7 +344,7 @@ development version. See the `Django 0.96 documentation`_ for the old behavior. ``ImageField`` ~~~~~~~~~~~~~~ -Like ``FileField``, but validates that the uploaded object is a valid +Like `FileField`_, but validates that the uploaded object is a valid image. Has two extra optional arguments, ``height_field`` and ``width_field``, which, if set, will be auto-populated with the height and width of the image each time a model instance is saved. diff --git a/docs/newforms.txt b/docs/newforms.txt index 503bd6634f..499892234c 100644 --- a/docs/newforms.txt +++ b/docs/newforms.txt @@ -1462,10 +1462,10 @@ commonly used groups of widgets: ``Textarea`` ```` ``CheckboxInput`` ``