diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-06-30 15:38:16 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-06-30 15:38:16 +0000 |
| commit | 829fd5a9670a581309797f56bfc7e5140550e873 (patch) | |
| tree | 6efe30b93fd5fc6564392f1dbaaf04c95a4b6bc2 /docs | |
| parent | c349ba4cfc2d137da393bddbda6e78fdb98c9c81 (diff) | |
newforms-admin: Merged from trunk up to [7808]. Fixed #7519, #7573
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7809 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/apache_auth.txt | 8 | ||||
| -rw-r--r-- | docs/db-api.txt | 25 | ||||
| -rw-r--r-- | docs/flatpages.txt | 7 | ||||
| -rw-r--r-- | docs/model-api.txt | 2 | ||||
| -rw-r--r-- | docs/testing.txt | 31 |
5 files changed, 68 insertions, 5 deletions
diff --git a/docs/apache_auth.txt b/docs/apache_auth.txt index 859050e716..62fd191896 100644 --- a/docs/apache_auth.txt +++ b/docs/apache_auth.txt @@ -39,9 +39,10 @@ with the standard ``Auth*`` and ``Require`` directives:: example at the bottom of this note). You'll also need to insert configuration directives that prevent Apache - from trying to use other authentication modules. Depending on which other - authentication modules you have loaded, you might need one or more of - the following directives:: + from trying to use other authentication modules, as well as specifying + the ``AuthUserFile`` directive and pointing it to ``/dev/null``. Depending + on which other authentication modules you have loaded, you might need one + or more of the following directives:: AuthBasicAuthoritative Off AuthDefaultAuthoritative Off @@ -65,6 +66,7 @@ with the standard ``Auth*`` and ``Require`` directives:: <Location /example/> AuthType Basic AuthName "example.com" + **AuthUserFile /dev/null** **AuthBasicAuthoritative Off** Require valid-user diff --git a/docs/db-api.txt b/docs/db-api.txt index f80d63797a..9a604bf320 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -443,6 +443,31 @@ This is roughly equivalent to:: Note, however, that the first of these will raise ``IndexError`` while the second will raise ``DoesNotExist`` if no objects match the given criteria. +Combining QuerySets +------------------- + +If you have two ``QuerySet`` instances that act on the same model, you can +combine them using ``&`` and ``|`` to get the items that are in both result +sets or in either results set, respectively. For example:: + + Entry.objects.filter(pubdate__gte=date1) & \ + Entry.objects.filter(headline__startswith="What") + +will combine the two queries into a single SQL query. Of course, in this case +you could have achieved the same result using multiple filters on the same +``QuerySet``, but sometimes the ability to combine individual ``QuerySet`` +instance is useful. + +Be careful, if you are using ``extra()`` to add custom handling to your +``QuerySet`` however. All the ``extra()`` components are merged and the result +may or may not make sense. If you are using custom SQL fragments in your +``extra()`` calls, Django will not inspect these fragments to see if they need +to be rewritten because of changes in the merged query. So test the effects +carefully. Also realise that if you are combining two ``QuerySets`` with +``|``, you cannot use ``extra(select=...)`` or ``extra(where=...)`` on *both* +``QuerySets``. You can only use those calls on one or the other (Django will +raise a ``ValueError`` if you try to use this incorrectly). + QuerySet methods that return new QuerySets ------------------------------------------ diff --git a/docs/flatpages.txt b/docs/flatpages.txt index a538217642..f1a354c653 100644 --- a/docs/flatpages.txt +++ b/docs/flatpages.txt @@ -14,9 +14,14 @@ custom Django application. A flatpage can use a custom template or a default, systemwide flatpage template. It can be associated with one, or multiple, sites. +**New in Django development version** + +The content field may optionally be left blank if you prefer to put your +content in a custom template. + Here are some examples of flatpages on Django-powered sites: - * http://www.chicagocrime.org/about/ + * http://www.everyblock.com/about/ * http://www.lawrence.com/about/contact/ Installation diff --git a/docs/model-api.txt b/docs/model-api.txt index 02a9fd2d95..4accad122a 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -1677,7 +1677,7 @@ still only creating one database table per child model at the database level. When an abstract base class is created, Django makes any ``Meta`` inner class you declared on the base class available as an attribute. If a child class -does not declared its own ``Meta`` class, it will inherit the parent's +does not declare its own ``Meta`` class, it will inherit the parent's ``Meta``. If the child wants to extend the parent's ``Meta`` class, it can subclass it. For example:: diff --git a/docs/testing.txt b/docs/testing.txt index befa6979af..0b18545efb 100644 --- a/docs/testing.txt +++ b/docs/testing.txt @@ -797,6 +797,37 @@ another test, or by the order of test execution. .. _dumpdata documentation: ../django-admin/#dumpdata-appname-appname .. _loaddata documentation: ../django-admin/#loaddata-fixture-fixture +URLconf configuration +~~~~~~~~~~~~~~~~~~~~~ + +**New in Django development version** + +If your application provides views, you may want to include tests that +use the test client to exercise those views. However, an end user is free +to deploy the views in your application at any URL of their choosing. +This means that your tests can't rely upon the fact that your views will +be available at a particular URL. + +In order to provide a reliable URL space for your test, +``django.test.TestCase`` provides the ability to customize the URLconf +configuration for the duration of the execution of a test suite. +If your ``TestCase`` instance defines an ``urls`` attribute, the +``TestCase`` will use the value of that attribute as the ``ROOT_URLCONF`` +for the duration of that test. + +For example:: + + from django.test import TestCase + + class TestMyViews(TestCase): + urls = 'myapp.test_urls' + + def testIndexPageView(self): + # Here you'd test your view using ``Client``. + +This test case will use the contents of ``myapp.test_urls`` as the +URLconf for the duration of the test case. + Emptying the test outbox ~~~~~~~~~~~~~~~~~~~~~~~~ |
