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
|
||||
answer newbie questions, and generally made Django that much better:
|
||||
|
||||
akaihola
|
||||
Andreas
|
||||
David Ascher <http://ascher.ca/>
|
||||
James Bennett
|
||||
|
|
|
@ -19,13 +19,10 @@ def ensure_default_manager(sender):
|
|||
cls.add_to_class('objects', Manager())
|
||||
cls.objects._prepare()
|
||||
|
||||
dispatcher.connect(
|
||||
ensure_default_manager,
|
||||
signal=signals.class_prepared
|
||||
)
|
||||
dispatcher.connect(ensure_default_manager, signal=signals.class_prepared)
|
||||
|
||||
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
|
||||
|
||||
def __init__(self):
|
||||
|
@ -176,7 +173,7 @@ class Manager(object):
|
|||
return obj_list[0]
|
||||
|
||||
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."
|
||||
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
|
||||
|
|
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.
|
||||
|
||||
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
|
||||
arrangements is forthcoming.
|
||||
as long as that server has WSGI_ hooks. See the `server arrangements wiki page`_.
|
||||
|
||||
.. _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?
|
||||
---------------------------------------
|
||||
|
@ -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
|
||||
.. _`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)?
|
||||
-------------------------------------------------------------------
|
||||
|
||||
|
@ -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 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
|
||||
|
||||
|
|
|
@ -65,6 +65,10 @@ Article 4
|
|||
{3: Article 3}
|
||||
>>> 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
|
||||
# dictionaries instead of object instances -- and you can specify which fields
|
||||
|
|
Loading…
Reference in New Issue