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]
class Meta[source]
model[source]

alias of reviewboard.reviews.models.default_reviewer.DefaultReviewer

error_messages = {u'groups': {u'invalid_choice': u'A group with ID %(value)s was not found.', u'invalid_pk_value': u'"%(pk)s" is an invalid group ID.'}}[source]
fields = u'__all__'[source]
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>}[source]
class GroupForm(data=None, initial={}, request=None, *args, **kwargs)[source]

Bases: reviewboard.site.mixins.LocalSiteAwareModelFormMixin, django.forms.models.ModelForm

class Meta[source]
model[source]

alias of reviewboard.reviews.models.group.Group

fields = u'__all__'[source]
declared_fields = {'users': <django.forms.models.ModelMultipleChoiceField object>}[source]
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:
  • 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:dict
Raises:django.core.exceptions.ValidationError – The form failed validation.
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>}[source]
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
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>}[source]
class UploadScreenshotForm(data=None, files=None, auto_id=u'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]
declared_fields = {'caption': <django.forms.fields.CharField object>, 'path': <django.forms.fields.ImageField object>}[source]