diff --git a/AUTHORS b/AUTHORS index 42f73a2d12..73fe3078c9 100644 --- a/AUTHORS +++ b/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 James Bennett diff --git a/django/db/models/manager.py b/django/db/models/manager.py index cbefdf1aea..29eb371db8 100644 --- a/django/db/models/manager.py +++ b/django/db/models/manager.py @@ -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 diff --git a/docs/faq.txt b/docs/faq.txt index cd8912a706..9899be0a50 100644 --- a/docs/faq.txt +++ b/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 diff --git a/tests/modeltests/lookup/models.py b/tests/modeltests/lookup/models.py index 599cff44d0..9d5c5af07d 100644 --- a/tests/modeltests/lookup/models.py +++ b/tests/modeltests/lookup/models.py @@ -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