Jump to >

reviewboard.webapi.base

class WebAPIResource[source]

Bases: djblets.webapi.resources.mixins.api_tokens.ResourceAPITokenMixin, djblets.webapi.resources.mixins.queries.APIQueryUtilsMixin, djblets.webapi.resources.base.WebAPIResource

A specialization of the Djblets WebAPIResource for Review Board.

autogenerate_etags = True[source]
mimetype_vendor = u’reviewboard.org’[source]
api_token_model[source]

alias of WebAPIToken

has_access_permissions(*args, **kwargs)[source]
get(*args, **kwargs)[source]

Returns the serialized object for the resource.

This will require login if anonymous access isn’t enabled on the site.

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

Returns a list of objects.

This will require login if anonymous access isn’t enabled on the site.

If ?counts-only=1 is passed on the URL, then this will return only a count field with the number of entries, instead of the serialized objects.

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

Handles HTTP DELETE requests to object resources.

This is used to delete an object, if the user has permissions to do so.

By default, this deletes the object and returns HTTP 204 No Content.

can_import_extra_data_field(obj, field)[source]

Returns whether a particular field in extra_data can be imported.

Subclasses can use this to limit which fields are imported by import_extra_data. By default, all fields can be imported.

build_resource_url(name, local_site_name=None, request=None, **kwargs)[source]

Build the URL to a resource, factoring in Local Sites.

Parameters:
  • name (unicode) – The resource name.
  • local_site_name (unicode) – The LocalSite name.
  • request (django.http.HttpRequest) – The HTTP request from the client.
  • kwargs (dict) – The keyword arguments needed for URL resolution.
Returns:

The resulting absolute URL to the resource.

Return type:

unicode

import_extra_data(obj, extra_data, fields)[source]