Exception Value: object of type 'PolymorphicModelBase' has no len()
<p>I am converting existing models/admin over to django-polymorphic.  I think I have the models and migrations done successfully (at least, it's working in the shell) but I can't get the admin to work.  I'm finding the <a href="http://django-polymorphic.readthedocs.io/en/stable/admin.html#setup" rel="nofollow">documentation</a> a little fuzzy, but I think I've followed it correctly.</p>

<pre><code>class LibraryItemAdmin(PolymorphicParentModelAdmin):
    base_model = LibraryItem
    child_models = (Whitepaper)


class LibraryItemChildAdmin(PolymorphicChildModelAdmin):
    base_model = LibraryItem


class WhitepaperAdmin(LibraryItemChildAdmin):
    form = LibraryForm
    base_model = Whitepaper
</code></pre>

<p>I don't understand the issue:</p>

<pre><code>Traceback:
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  108.                 response = middleware_method(request)
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/middleware/common.py" in process_request
  74.             if (not urlresolvers.is_valid_path(request.path_info, urlconf) and
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in is_valid_path
  646.         resolve(path, urlconf)
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  521.     return get_resolver(urlconf).resolve(path)
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in resolve
  365.             for pattern in self.url_patterns:
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in url_patterns
  401.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in urlconf_module
  395.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.7/importlib/__init__.py" in import_module
  37.     __import__(name)
File "/srv/www/urls.py" in &lt;module&gt;
  349.     url(r'^admin/', include(admin.site.urls), name='admin'),
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in urls
  291.         return self.get_urls(), 'admin', self.name
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in get_urls
  275.                 url(r'^%s/%s/' % (model._meta.app_label, model._meta.model_name), include(model_admin.urls)),
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in urls
  631.         return self.get_urls()
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/polymorphic/admin/parentadmin.py" in get_urls
  283.         self._lazy_setup()
File "/root/.virtualenvs/divesite/local/lib/python2.7/site-packages/polymorphic/admin/parentadmin.py" in _lazy_setup
  92.         self._compat_mode = len(child_models) and isinstance(child_models[0], (list, tuple))

Exception Type: TypeError at /admin/library
Exception Value: object of type 'PolymorphicModelBase' has no len()
</code></pre>

<p>Documentation is out of date.  Bad docs.  Bad.</p>

<p>child_models should be an iterable of (Model, ModelAdmin) tuples.</p>

<p><a href="https://github.com/django-polymorphic/django-polymorphic/issues/227" rel="nofollow">https://github.com/django-polymorphic/django-polymorphic/issues/227</a></p>

python django django-polymorphic