Jump to >

reviewboard.reviews.forms

regex_validator(value)[source]

Validates that the specified regular expression is valid.

class DefaultReviewerForm(data=None, initial={}, request=None, *args, **kwargs)[source]

Bases: reviewboard.site.mixins.LocalSiteAwareModelFormMixin, django.forms.models.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 reviewboard.reviews.models.default_reviewer.DefaultReviewer

error_messages = {'groups': {'invalid_choice': 'A group with ID %(value)s was not found.', 'invalid_pk_value': '"%(pk)s" is an invalid group ID.'}}[source]
fields = '__all__'[source]
__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: reviewboard.site.mixins.LocalSiteAwareModelFormMixin, django.forms.models.ModelForm

class Meta[source]

Bases: object

model[source]

alias of reviewboard.reviews.models.group.Group

fields = '__all__'[source]
__annotations__ = {}
declared_fields = {'users': <django.forms.models.ModelMultipleChoiceField object>}
class UploadCommitForm(review_request, *args, **kwargs)[source]

Bases: reviewboard.diffviewer.forms.UploadCommitForm

A specialized UploadCommitForm for interacting with review requests.

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

Initialize the form.

Parameters
clean()[source]

Clean the form.

Returns

The cleaned form data.

Return type

dict

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: reviewboard.diffviewer.forms.UploadDiffForm

A specialized UploadDiffForm for interacting with review requests.

__init__(review_request, request=None, *args, **kwargs)[source]

Initialize the form.

Parameters
clean()[source]

Clean the form.

This ensures that the associated review request was not created with history.

Returns

The cleaned form data.

Return type

dict

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 the reviewboard.reviews.models.review_request. ReviewRequest.

Defaults to False.

Returns

The created DiffSet.

Return type

reviewboard.diffviewer.models.diffset.DiffSet

__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: django.forms.forms.Form

A form that handles uploading of new screenshots. A screenshot takes a path argument and optionally a caption.

create(file, review_request)[source]
__annotations__ = {}
declared_fields = {'caption': <django.forms.fields.CharField object>, 'path': <django.forms.fields.ImageField object>}