reviewboard.admin.form_widgets¶
Admin-specific form widgets.
- class RelatedObjectWidget(local_site_name=None, multivalued=True)[source]¶
Bases:
RelatedObjectWidget
A base class form widget that lets people select one or more objects.
This is a base class. Extended classes must define their own render() method, to render their own widget with their own data.
This should be used with relatedObjectSelectorView.es6.js, which extends a Backbone view to display data.
- class RelatedUserWidget(local_site_name=None, multivalued=True)[source]¶
Bases:
RelatedObjectWidget
A form widget to allow people to select one or more User relations.
It’s not unheard of to have a server with thousands or tens of thousands of registered users. In this case, the existing Django admin widgets fall down hard. The filtered select widgets can actually crash the webserver due to trying to pre-populate an enormous
<select>
element, and the raw ID widget is basically a write-only field.This field does much better, offering both the ability to see who’s already in the list, as well as interactive search and filtering.
- render(name, value, attrs=None, renderer=None)[source]¶
Render the widget.
- Parameters:
- Returns:
The rendered HTML.
- Return type:
django.utils.safestring.SafeText
- __slotnames__ = []¶
- class RelatedRepositoryWidget(local_site_name=None, multivalued=True)[source]¶
Bases:
RelatedObjectWidget
A form widget allowing people to select one or more Repository objects.
This widget offers both the ability to see which repositories are already in the list, as well as interactive search and filtering.
- render(name, value, attrs=None, renderer=None)[source]¶
Render the widget.
- Parameters:
- Returns:
The rendered HTML.
- Return type:
django.utils.safestring.SafeText
- value_from_datadict(data, files, name)[source]¶
Unpack the field’s value from a datadict.
- Parameters:
- Returns:
The list of IDs of
Repository
objects.- Return type:
- __slotnames__ = []¶
- class RelatedGroupWidget(invite_only=False, *args, **kwargs)[source]¶
Bases:
RelatedObjectWidget
A form widget allowing people to select one or more Group objects.
This widget offers both the ability to see which groups are already in the list, as well as interactive search and filtering.
- render(name, value, attrs=None, renderer=None)[source]¶
Render the widget.
- Parameters:
- Returns:
The rendered HTML.
- Return type:
django.utils.safestring.SafeText
- __slotnames__ = []¶
- class LexersMappingWidget(attrs=None)[source]¶
Bases:
MultiWidget
A form widget for mapping a string to a Pygments Lexer class.
This widget displays a text input with a drop-down list of Pygments Lexer names next to it.
New in version 5.0.
- __init__(attrs=None)[source]¶
Initialize the LexersMappingWidget.
- Parameters:
attrs (
dict
, optional) – A dictionary containing HTML attributes to be set on the rendered widget.