mirror of
https://github.com/django/django.git
synced 2025-05-11 09:26:29 +00:00
magic-removal: Merged to [1834]
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d33099252a
commit
bb8fb814a6
1
AUTHORS
1
AUTHORS
@ -31,6 +31,7 @@ And here is an inevitably incomplete list of MUCH-APPRECIATED CONTRIBUTORS --
|
|||||||
people who have submitted patches, reported bugs, added translations, helped
|
people who have submitted patches, reported bugs, added translations, helped
|
||||||
answer newbie questions, and generally made Django that much better:
|
answer newbie questions, and generally made Django that much better:
|
||||||
|
|
||||||
|
akaihola
|
||||||
Andreas
|
Andreas
|
||||||
David Ascher <http://ascher.ca/>
|
David Ascher <http://ascher.ca/>
|
||||||
James Bennett
|
James Bennett
|
||||||
|
@ -19,13 +19,10 @@ def ensure_default_manager(sender):
|
|||||||
cls.add_to_class('objects', Manager())
|
cls.add_to_class('objects', Manager())
|
||||||
cls.objects._prepare()
|
cls.objects._prepare()
|
||||||
|
|
||||||
dispatcher.connect(
|
dispatcher.connect(ensure_default_manager, signal=signals.class_prepared)
|
||||||
ensure_default_manager,
|
|
||||||
signal=signals.class_prepared
|
|
||||||
)
|
|
||||||
|
|
||||||
class Manager(object):
|
class Manager(object):
|
||||||
# Tracks each time a Manager instance is created. Used to retain order.
|
# Tracks each time a Manager instance is created. Used to retain order.
|
||||||
creation_counter = 0
|
creation_counter = 0
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -176,7 +173,7 @@ class Manager(object):
|
|||||||
return obj_list[0]
|
return obj_list[0]
|
||||||
|
|
||||||
def get_in_bulk(self, *args, **kwargs):
|
def get_in_bulk(self, *args, **kwargs):
|
||||||
id_list = args and args[0] or kwargs['id_list']
|
id_list = args and args[0] or kwargs.get('id_list', [])
|
||||||
assert id_list != [], "get_in_bulk() cannot be passed an empty list."
|
assert id_list != [], "get_in_bulk() cannot be passed an empty list."
|
||||||
kwargs['where'] = ["%s.%s IN (%s)" % (backend.quote_name(self.klass._meta.db_table), backend.quote_name(self.klass._meta.pk.column), ",".join(['%s'] * len(id_list)))]
|
kwargs['where'] = ["%s.%s IN (%s)" % (backend.quote_name(self.klass._meta.db_table), backend.quote_name(self.klass._meta.pk.column), ",".join(['%s'] * len(id_list)))]
|
||||||
kwargs['params'] = id_list
|
kwargs['params'] = id_list
|
||||||
|
10
docs/faq.txt
10
docs/faq.txt
@ -213,10 +213,10 @@ For production use, though, we recommend mod_python. The Django developers have
|
|||||||
been running it on mod_python for about two years, and it's quite stable.
|
been running it on mod_python for about two years, and it's quite stable.
|
||||||
|
|
||||||
However, if you don't want to use mod_python, you can use a different server,
|
However, if you don't want to use mod_python, you can use a different server,
|
||||||
as long as that server has WSGI_ hooks. More information on alternate server
|
as long as that server has WSGI_ hooks. See the `server arrangements wiki page`_.
|
||||||
arrangements is forthcoming.
|
|
||||||
|
|
||||||
.. _WSGI: http://www.python.org/peps/pep-0333.html
|
.. _WSGI: http://www.python.org/peps/pep-0333.html
|
||||||
|
.. _server arrangements wiki page: http://code.djangoproject.com/wiki/ServerArrangements
|
||||||
|
|
||||||
How do I install mod_python on Windows?
|
How do I install mod_python on Windows?
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
@ -231,8 +231,6 @@ How do I install mod_python on Windows?
|
|||||||
.. _`Running mod_python on Apache on Windows2000`: http://groups-beta.google.com/group/comp.lang.python/msg/139af8c83a5a9d4f
|
.. _`Running mod_python on Apache on Windows2000`: http://groups-beta.google.com/group/comp.lang.python/msg/139af8c83a5a9d4f
|
||||||
.. _`guide to getting mod_python working`: http://www.dscpl.com.au/articles/modpython-001.html
|
.. _`guide to getting mod_python working`: http://www.dscpl.com.au/articles/modpython-001.html
|
||||||
|
|
||||||
(Thanks to deelan for this info.)
|
|
||||||
|
|
||||||
Will Django run under shared hosting (like TextDrive or Dreamhost)?
|
Will Django run under shared hosting (like TextDrive or Dreamhost)?
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
@ -306,7 +304,9 @@ Using a ``FileField`` or an ``ImageField`` in a model takes a few steps:
|
|||||||
If I make changes to a model, how do I update the database?
|
If I make changes to a model, how do I update the database?
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
|
||||||
If you don't care about clearing data, just do this::
|
If you don't care about clearing data, just pipe the output of the
|
||||||
|
appropriate ``django-admin.py sqlreset`` command into your database's
|
||||||
|
command-line utility. For example::
|
||||||
|
|
||||||
django-admin.py sqlreset appname | psql dbname
|
django-admin.py sqlreset appname | psql dbname
|
||||||
|
|
||||||
|
@ -65,6 +65,10 @@ Article 4
|
|||||||
{3: Article 3}
|
{3: Article 3}
|
||||||
>>> Article.objects.get_in_bulk([1000])
|
>>> Article.objects.get_in_bulk([1000])
|
||||||
{}
|
{}
|
||||||
|
>>> Article.objects.get_in_bulk([])
|
||||||
|
Traceback (most recent call last):
|
||||||
|
...
|
||||||
|
AssertionError: get_in_bulk() cannot be passed an empty list.
|
||||||
|
|
||||||
# get_values() is just like get_list(), except it returns a list of
|
# get_values() is just like get_list(), except it returns a list of
|
||||||
# dictionaries instead of object instances -- and you can specify which fields
|
# dictionaries instead of object instances -- and you can specify which fields
|
||||||
|
Loading…
x
Reference in New Issue
Block a user