#10635: list_editable: logic error when checking for ordering property ----------------------------------+----------------------------------------- Reporter: mkb...@gmail.com | Owner: nobody Status: new | Milestone: Component: django.contrib.admin | Version: 1.1-beta-1 Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------------+----------------------------------------- {{{ >>> l = (opts.ordering or cls.ordering) >>> l [ '-id' ] >>> not l False >>> }}}
Following patch fixes this bug. {{{ To apply: $ cd <django-src-root> $ patch -p0 < contrib.admin.validate.patch0 For example, $ cd /usr/lib/python2.5/site-packages/django/ $ sudo patch -p0 < $OLDPWD/contrib.admin.validate.patch0 $ cd - --- /dev/null +++ ./contrib/admin/validation.py 2009-03-26 10:37:36.000000000 -0400 @@ -67,7 +67,7 @@ # list_editable if hasattr(cls, 'list_editable') and cls.list_editable: check_isseq(cls, 'list_editable', cls.list_editable) - if not (opts.ordering or cls.ordering): + if not len(opts.ordering or cls.ordering): raise ImproperlyConfigured("'%s.list_editable' cannot be used " "without a default ordering. Please define ordering on either %s or %s." % (cls.__name__, cls.__name__, model.__name__)) }}} -- Ticket URL: <http://code.djangoproject.com/ticket/10635> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---