Added support for extension admin sites

Review Request #2888 — Created Feb. 16, 2012 and submitted — Latest diff uploaded

Information

Djblets

Reviewers

This adds support for extensions to have their own admin site by setting extension.has_admin_site = True.

In order to add an admin site to an extension, the following steps must be taken:
  1. extension.has_admin_site = True

  2. Models registered in admin.py
    - ex:
      extension_manager = get_extension_manager()
      extension = extension_manager.get_enabled_extension(ExtensionClassName.id)
      extension.admin_site.register(ModelName, ModelAdminName)

The admin site will be generated and a link Database link will appear on the extension list.

Currently there is a bug due to interaction between action logs from the main admin site, and the extension admin sites. Since the models for Review Board are not registered with the extension admin site, and vice versa, clicking a recent action on the admin site page which originated from the other admin site will link to an invalid url. This is a django bug, and I have filed an issue: https://code.djangoproject.com/ticket/17726
Tested by creating admin site for rbwebhooks extension.
    Loading...