divio/django-cms — pull request #1135 by jslang (2012-01-06 19:08:51+00:00)
Title: Fixed negative index exception

Related to this change:

https://github.com/divio/django-cms/commit/aa1e0ce2d3e54f6dceec6eda919dddec5da899b0#L0L120

Children variable was changed from empty list to queryset, but a negative index was still used later on causing an exception to be thrown. Also changed how children length is calculated, opting to use the queryset method count instead of len function, to avoid loading the data before necessary.