mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[multi-db] Merge trunk to [3764]. Some tests still failing.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c000f6a480
commit
f6d48b5d02
@ -74,8 +74,9 @@ def fastcgi_help(message=None):
|
||||
print message
|
||||
return False
|
||||
|
||||
def runfastcgi(argset):
|
||||
def runfastcgi(argset, **kwargs):
|
||||
options = FASTCGI_OPTIONS.copy()
|
||||
options.update(kwargs)
|
||||
for x in argset:
|
||||
if "=" in x:
|
||||
k, v = x.split('=', 1)
|
||||
|
@ -295,6 +295,8 @@ give you the option of creating a superuser immediately.
|
||||
test
|
||||
----
|
||||
|
||||
**New in Django development version**
|
||||
|
||||
Discover and run tests for all installed models. See `Testing Django applications`_ for more information.
|
||||
|
||||
.. _testing django applications: ../testing/
|
||||
@ -348,6 +350,8 @@ options.
|
||||
--noinput
|
||||
---------
|
||||
|
||||
**New in Django development version**
|
||||
|
||||
Inform django-admin that the user should NOT be prompted for any input. Useful if
|
||||
the django-admin script will be executed as an unattended, automated script.
|
||||
|
||||
@ -369,6 +373,8 @@ Example output::
|
||||
--verbosity
|
||||
-----------
|
||||
|
||||
**New in Django development version**
|
||||
|
||||
Example usage::
|
||||
|
||||
django-admin.py syncdb --verbosity=2
|
||||
|
@ -270,7 +270,7 @@ In your Web root directory, add this to a file named ``.htaccess`` ::
|
||||
AddHandler fastcgi-script .fcgi
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^/(.*)$ /mysite.fcgi/$1 [QSA,L]
|
||||
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]
|
||||
|
||||
Then, create a small script that tells Apache how to spawn your FastCGI
|
||||
program. Create a file ``mysite.fcgi`` and place it in your Web directory, and
|
||||
@ -289,7 +289,7 @@ be sure to make it executable ::
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = "myproject.settings"
|
||||
|
||||
from django.core.servers.fastcgi import runfastcgi
|
||||
runfastcgi(["method=threaded", "daemonize=false"])
|
||||
runfastcgi(method="threaded", daemonize="false")
|
||||
|
||||
Restarting the spawned server
|
||||
-----------------------------
|
||||
|
@ -321,7 +321,7 @@ about editing an existing one? It's shockingly similar to creating a new one::
|
||||
else:
|
||||
errors = {}
|
||||
# This makes sure the form accurate represents the fields of the place.
|
||||
new_data = place.__dict__
|
||||
new_data = manipulator.flatten_data()
|
||||
|
||||
form = forms.FormWrapper(manipulator, new_data, errors)
|
||||
return render_to_response('places/edit_form.html', {'form': form, 'place': place})
|
||||
@ -336,10 +336,10 @@ The only real differences are:
|
||||
* ``ChangeManipulator.original_object`` stores the instance of the
|
||||
object being edited.
|
||||
|
||||
* We set ``new_data`` to the original object's ``__dict__``. This makes
|
||||
sure the form fields contain the current values of the object.
|
||||
``FormWrapper`` does not modify ``new_data`` in any way, and templates
|
||||
cannot, so this is perfectly safe.
|
||||
* We set ``new_data`` based upon ``flatten_data()`` from the manipulator.
|
||||
``flatten_data()`` takes the data from the original object under
|
||||
manipulation, and converts it into a data dictionary that can be used
|
||||
to populate form elements with the existing values for the object.
|
||||
|
||||
* The above example uses a different template, so create and edit can be
|
||||
"skinned" differently if needed, but the form chunk itself is completely
|
||||
|
Loading…
x
Reference in New Issue
Block a user