1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Changed get_object() not to use 'ordering' parameter from the model. Thanks, Ned Batchelder. Also updated some unit tests to show correct DoesNotExist output

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty
2006-02-25 17:24:17 +00:00
parent de66a3a7da
commit 250281361d
4 changed files with 4 additions and 3 deletions

View File

@@ -1352,6 +1352,7 @@ def _get_where_clause(lookup_type, table_prefix, field_name, value):
raise TypeError, "Got invalid lookup_type: %s" % repr(lookup_type)
def function_get_object(opts, klass, does_not_exist_exception, **kwargs):
kwargs['order_by'] = kwargs.get('order_by', ())
obj_list = function_get_list(opts, klass, **kwargs)
if len(obj_list) < 1:
raise does_not_exist_exception, "%s does not exist for %s" % (opts.object_name, kwargs)