Jump to >

reviewboard.admin.admin_sites

Django AdminSite customization for Review Board.

class AuthenticationForm(request=None, *args, **kwargs)[source]

Bases: reviewboard.accounts.forms.auth.ReviewBoardAuthenticationFormMixin, django.contrib.admin.forms.AdminAuthenticationForm

Authentication form for the administration UI.

This builds upon the main admin authentication form (which handles permission checks when verifying a username) by incorporating the capabilities of the main Review Board administration form, allowing e-mail addresses as usernames and rate limiting login attempts.

New in version 4.0.

declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}[source]
class AdminSite(*args, **kwargs)[source]

Bases: django.contrib.admin.sites.AdminSite

Main administration site for Review Board.

This provides customization of the administration UI, while maintaining Model/Admin registration compatibility with the standard Django administration UI.

Technically, this is focused on the Database section of the administration UI, though it’s planned to be used to consolidate more of the UI in the future.

All code should reference admin_site where possible, rather than django.contrib.admin.site.

New in version 4.0.

site_title = u'Database'[source]
site_header = u'Database'[source]
index_title = u'Database'[source]
login_form[source]

alias of AuthenticationForm

__init__(*args, **kwargs)[source]

Initialize the site.

Parameters:
  • *args (tuple) – Positional arguments for the parent class.
  • **kwargs (dict) – Keyword arguments for the parent class.
get_model_admin(model_cls)[source]

Return the ModelAdmin for a given Model class.

Parameters:model_cls (type) – The registered model class.
Returns:The ModelAdmin for the Model, or None if one is not registered.
Return type:django.contrib.admin.ModelAdmin
admin_site = <reviewboard.admin.admin_sites.AdminSite object>[source]

The main instance for the Review Board administration site.

New in version 4.0.