reviewboard.reviews.forms¶
- class DefaultReviewerForm(data=None, initial={}, request=None, *args, **kwargs)[source]¶
Bases:
LocalSiteAwareModelFormMixin
,ModelForm
- clean()[source]¶
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- class Meta[source]¶
Bases:
object
- model[source]¶
alias of
DefaultReviewer
- __annotations__ = {}¶
- declared_fields = {'file_regex': <django.forms.fields.CharField object>, 'groups': <django.forms.models.ModelMultipleChoiceField object>, 'name': <django.forms.fields.CharField object>, 'people': <django.forms.models.ModelMultipleChoiceField object>, 'repository': <django.forms.models.ModelMultipleChoiceField object>}¶
- class GroupForm(data=None, initial={}, request=None, *args, **kwargs)[source]¶
Bases:
LocalSiteAwareModelFormMixin
,ModelForm
- __annotations__ = {}¶
- declared_fields = {'users': <django.forms.models.ModelMultipleChoiceField object>}¶
- class UploadCommitForm(review_request, *args, **kwargs)[source]¶
Bases:
UploadCommitForm
A specialized UploadCommitForm for interacting with review requests.
- __init__(review_request, *args, **kwargs)[source]¶
Initialize the form.
- Parameters:
review_request (
reviewboard.reviews.models.review_request.ReviewRequest
) – The review request that the uploaded commit will be attached to.*args (
tuple
) – Additional positional arguments.**kwargs (
dict
) – Additional keyword arguments.
- clean()[source]¶
Clean the form.
- Returns:
The cleaned form data.
- Return type:
- Raises:
django.core.exceptions.ValidationError – The form failed validation.
- __annotations__ = {}¶
- declared_fields = {'author_date': <django.forms.fields.CharField object>, 'author_email': <django.forms.fields.CharField object>, 'author_name': <django.forms.fields.CharField object>, 'commit_id': <django.forms.fields.CharField object>, 'commit_message': <django.forms.fields.CharField object>, 'committer_date': <django.forms.fields.CharField object>, 'committer_email': <django.forms.fields.CharField object>, 'committer_name': <django.forms.fields.CharField object>, 'diff': <django.forms.fields.FileField object>, 'parent_diff': <django.forms.fields.FileField object>, 'parent_id': <django.forms.fields.CharField object>, 'validation_info': <django.forms.fields.CharField object>}¶
- class UploadDiffForm(review_request, request=None, *args, **kwargs)[source]¶
Bases:
UploadDiffForm
A specialized UploadDiffForm for interacting with review requests.
- __init__(review_request, request=None, *args, **kwargs)[source]¶
Initialize the form.
- Parameters:
review_request (
reviewboard.reviews.models.ReviewRequest
) – The review request that the uploaded diff will be attached to.request (
django.http.HttpRequest
) – The current HTTP request.*args (
tuple
) – Additional positional arguments.**kwargs (
dict
) – Additional keyword arguments.
- clean()[source]¶
Clean the form.
This ensures that the associated review request was not created with history.
- Returns:
The cleaned form data.
- Return type:
- Raises:
django.core.exceptions.ValidationError – The form cannot be validated.
- create(attach_to_history=False)[source]¶
Create the DiffSet and optionally attach it to the history.
- Parameters:
attach_to_history (
bool
) –Whether or not the created
DiffSet
will be attached to the diffset history of thereviewboard.reviews.models.review_request. ReviewRequest
.Defaults to
False
.- Returns:
The created DiffSet.
- Return type:
- __annotations__ = {}¶
- declared_fields = {'base_commit_id': <django.forms.fields.CharField object>, 'basedir': <django.forms.fields.CharField object>, 'parent_diff_path': <django.forms.fields.FileField object>, 'path': <django.forms.fields.FileField object>}¶
- class UploadScreenshotForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]¶
Bases:
Form
A form that handles uploading of new screenshots. A screenshot takes a path argument and optionally a caption.
- __annotations__ = {}¶
- declared_fields = {'caption': <django.forms.fields.CharField object>, 'path': <django.forms.fields.ImageField object>}¶