• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Djblets 2.0
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.x
    6. Version 2.0
    7. Version 1.0
    8. Version 0.9
    9. Djblets Documentation
    10. Module and Class References
    11. djblets.webapi.fields
  • Home
  • Guides
  • Avatar Services Guides
  • Writing Avatar Services
  • Extension Guides
  • Writing Extensions
  • Testing Extensions
  • Feature Checks Guides
  • Introduction to Feature Checks
  • Writing Features
  • Writing Feature Checkers
  • Testing with Feature Checks
  • Integration Guides
  • Supporting Integrations
  • Writing Integrations
  • Privacy Compliance Guides
  • Getting and Checking Consent
  • Working with Personally Identifiable Information
  • Service Integrations
  • reCAPTCHA Guides
  • Using reCAPTCHA
  • Registries Guides
  • Writing Registries
  • Web API Guides
  • Writing Web API Resources
  • Adding OAuth2 Support
  • Module and Class References
  • djblets
  • djblets.deprecation
  • djblets.auth.forms
  • djblets.auth.ratelimit
  • djblets.auth.signals
  • djblets.auth.util
  • djblets.auth.views
  • djblets.avatars.errors
  • djblets.avatars.forms
  • djblets.avatars.registry
  • djblets.avatars.services
  • djblets.avatars.services.base
  • djblets.avatars.services.fallback
  • djblets.avatars.services.file_upload
  • djblets.avatars.services.gravatar
  • djblets.avatars.services.url
  • djblets.avatars.settings
  • djblets.cache.backend
  • djblets.cache.backend_compat
  • djblets.cache.context_processors
  • djblets.cache.errors
  • djblets.cache.forwarding_backend
  • djblets.cache.serials
  • djblets.cache.synchronizer
  • djblets.conditions
  • djblets.conditions.choices
  • djblets.conditions.conditions
  • djblets.conditions.errors
  • djblets.conditions.operators
  • djblets.conditions.values
  • djblets.configforms.forms
  • djblets.configforms.mixins
  • djblets.configforms.pages
  • djblets.configforms.registry
  • djblets.configforms.views
  • djblets.datagrid.grids
  • djblets.datagrid.templatetags.datagrid
  • djblets.db.backends.mysql.base
  • djblets.db.fields
  • djblets.db.fields.base64_field
  • djblets.db.fields.counter_field
  • djblets.db.fields.json_field
  • djblets.db.fields.modification_timestamp_field
  • djblets.db.fields.relation_counter_field
  • djblets.db.managers
  • djblets.db.query
  • djblets.db.validators
  • djblets.extensions.admin
  • djblets.extensions.errors
  • djblets.extensions.extension
  • djblets.extensions.forms
  • djblets.extensions.hooks
  • djblets.extensions.loaders
  • djblets.extensions.manager
  • djblets.extensions.middleware
  • djblets.extensions.models
  • djblets.extensions.packaging
  • djblets.extensions.resources
  • djblets.extensions.settings
  • djblets.extensions.signals
  • djblets.extensions.staticfiles
  • djblets.extensions.testing
  • djblets.extensions.testing.testcases
  • djblets.extensions.urls
  • djblets.extensions.views
  • djblets.extensions.templatetags.djblets_extensions
  • djblets.features
  • djblets.features.checkers
  • djblets.features.decorators
  • djblets.features.errors
  • djblets.features.feature
  • djblets.features.level
  • djblets.features.registry
  • djblets.features.testing
  • djblets.features.templatetags.features
  • djblets.feedview.views
  • djblets.feedview.templatetags.feedtags
  • djblets.forms.fields
  • djblets.forms.fieldsets
  • djblets.forms.forms
  • djblets.forms.forms.key_value_form
  • djblets.forms.widgets
  • djblets.gravatars
  • djblets.gravatars.templatetags.gravatars
  • djblets.http.middleware
  • djblets.integrations.errors
  • djblets.integrations.forms
  • djblets.integrations.hooks
  • djblets.integrations.integration
  • djblets.integrations.manager
  • djblets.integrations.mixins
  • djblets.integrations.models
  • djblets.integrations.templatetags.integrations
  • djblets.integrations.urls
  • djblets.integrations.views
  • djblets.log
  • djblets.log.middleware
  • djblets.log.siteconfig
  • djblets.log.urls
  • djblets.log.views
  • djblets.mail.dmarc
  • djblets.mail.message
  • djblets.mail.testing
  • djblets.mail.utils
  • djblets.markdown
  • djblets.markdown.extensions.escape_html
  • djblets.markdown.extensions.wysiwyg
  • djblets.markdown.extensions.wysiwyg_email
  • djblets.pipeline.compilers.es6.ES6Compiler
  • djblets.pipeline.compilers.less.LessCompiler
  • djblets.privacy.consent
  • djblets.privacy.consent.base
  • djblets.privacy.consent.common
  • djblets.privacy.consent.errors
  • djblets.privacy.consent.forms
  • djblets.privacy.consent.hooks
  • djblets.privacy.consent.registry
  • djblets.privacy.consent.tracker
  • djblets.privacy.models
  • djblets.privacy.pii
  • djblets.privacy.templatetags.djblets_privacy
  • djblets.recaptcha.mixins
  • djblets.recaptcha.siteconfig
  • djblets.recaptcha.templatetags.djblets_recaptcha
  • djblets.recaptcha.widgets
  • djblets.registries
  • djblets.registries.errors
  • djblets.registries.importer
  • djblets.registries.mixins
  • djblets.registries.registry
  • djblets.registries.signals
  • djblets.siteconfig
  • djblets.siteconfig.admin
  • djblets.siteconfig.context_processors
  • djblets.siteconfig.django_settings
  • djblets.siteconfig.forms
  • djblets.siteconfig.managers
  • djblets.siteconfig.middleware
  • djblets.siteconfig.models
  • djblets.siteconfig.signals
  • djblets.siteconfig.views
  • djblets.template.caches
  • djblets.template.context
  • djblets.template.loaders.conditional_cached
  • djblets.template.loaders.namespaced_app_dirs
  • djblets.testing.decorators
  • djblets.testing.testcases
  • djblets.testing.testrunners
  • djblets.urls.context_processors
  • djblets.urls.decorators
  • djblets.urls.patterns
  • djblets.urls.resolvers
  • djblets.urls.root
  • djblets.urls.staticfiles
  • djblets.util.compat.django.core.cache
  • djblets.util.compat.django.core.files.locks
  • djblets.util.compat.django.core.management.base
  • djblets.util.compat.django.core.validators
  • djblets.util.compat.django.shortcuts
  • djblets.util.compat.django.template.context
  • djblets.util.compat.django.template.loader
  • djblets.util.compat.django.utils.functional
  • djblets.util.compat.python.past
  • djblets.util.contextmanagers
  • djblets.util.dates
  • djblets.util.decorators
  • djblets.util.filesystem
  • djblets.util.html
  • djblets.util.http
  • djblets.util.humanize
  • djblets.util.json_utils
  • djblets.util.properties
  • djblets.util.serializers
  • djblets.util.templatetags.djblets_deco
  • djblets.util.templatetags.djblets_email
  • djblets.util.templatetags.djblets_forms
  • djblets.util.templatetags.djblets_images
  • djblets.util.templatetags.djblets_js
  • djblets.util.templatetags.djblets_utils
  • djblets.util.views
  • djblets.views.generic.base
  • djblets.views.generic.etag
  • djblets.webapi.auth
  • djblets.webapi.auth.backends
  • djblets.webapi.auth.backends.api_tokens
  • djblets.webapi.auth.backends.base
  • djblets.webapi.auth.backends.basic
  • djblets.webapi.auth.backends.oauth2_tokens
  • djblets.webapi.auth.views
  • djblets.webapi.decorators
  • djblets.webapi.encoders
  • djblets.webapi.errors
  • djblets.webapi.fields
  • djblets.webapi.managers
  • djblets.webapi.models
  • djblets.webapi.oauth2_scopes
  • djblets.webapi.resources
  • djblets.webapi.resources.base
  • djblets.webapi.resources.group
  • djblets.webapi.resources.registry
  • djblets.webapi.resources.root
  • djblets.webapi.resources.user
  • djblets.webapi.resources.mixins.api_tokens
  • djblets.webapi.resources.mixins.forms
  • djblets.webapi.resources.mixins.oauth2_tokens
  • djblets.webapi.resources.mixins.queries
  • djblets.webapi.responses
  • djblets.webapi.signals
  • djblets.webapi.testing
  • djblets.webapi.testing.decorators
  • djblets.webapi.testing.testcases
  • djblets
  • djblets.deprecation
  • djblets.auth.forms
  • djblets.auth.ratelimit
  • djblets.auth.signals
  • djblets.auth.util
  • djblets.auth.views
  • djblets.avatars.errors
  • djblets.avatars.forms
  • djblets.avatars.registry
  • djblets.avatars.services
  • djblets.avatars.services.base
  • djblets.avatars.services.fallback
  • djblets.avatars.services.file_upload
  • djblets.avatars.services.gravatar
  • djblets.avatars.services.url
  • djblets.avatars.settings
  • djblets.cache.backend
  • djblets.cache.backend_compat
  • djblets.cache.context_processors
  • djblets.cache.errors
  • djblets.cache.forwarding_backend
  • djblets.cache.serials
  • djblets.cache.synchronizer
  • djblets.conditions
  • djblets.conditions.choices
  • djblets.conditions.conditions
  • djblets.conditions.errors
  • djblets.conditions.operators
  • djblets.conditions.values
  • djblets.configforms.forms
  • djblets.configforms.mixins
  • djblets.configforms.pages
  • djblets.configforms.registry
  • djblets.configforms.views
  • djblets.datagrid.grids
  • djblets.datagrid.templatetags.datagrid
  • djblets.db.backends.mysql.base
  • djblets.db.fields
  • djblets.db.fields.base64_field
  • djblets.db.fields.counter_field
  • djblets.db.fields.json_field
  • djblets.db.fields.modification_timestamp_field
  • djblets.db.fields.relation_counter_field
  • djblets.db.managers
  • djblets.db.query
  • djblets.db.validators
  • djblets.extensions.admin
  • djblets.extensions.errors
  • djblets.extensions.extension
  • djblets.extensions.forms
  • djblets.extensions.hooks
  • djblets.extensions.loaders
  • djblets.extensions.manager
  • djblets.extensions.middleware
  • djblets.extensions.models
  • djblets.extensions.packaging
  • djblets.extensions.resources
  • djblets.extensions.settings
  • djblets.extensions.signals
  • djblets.extensions.staticfiles
  • djblets.extensions.testing
  • djblets.extensions.testing.testcases
  • djblets.extensions.urls
  • djblets.extensions.views
  • djblets.extensions.templatetags.djblets_extensions
  • djblets.features
  • djblets.features.checkers
  • djblets.features.decorators
  • djblets.features.errors
  • djblets.features.feature
  • djblets.features.level
  • djblets.features.registry
  • djblets.features.testing
  • djblets.features.templatetags.features
  • djblets.feedview.views
  • djblets.feedview.templatetags.feedtags
  • djblets.forms.fields
  • djblets.forms.fieldsets
  • djblets.forms.forms
  • djblets.forms.forms.key_value_form
  • djblets.forms.widgets
  • djblets.gravatars
  • djblets.gravatars.templatetags.gravatars
  • djblets.http.middleware
  • djblets.integrations.errors
  • djblets.integrations.forms
  • djblets.integrations.hooks
  • djblets.integrations.integration
  • djblets.integrations.manager
  • djblets.integrations.mixins
  • djblets.integrations.models
  • djblets.integrations.templatetags.integrations
  • djblets.integrations.urls
  • djblets.integrations.views
  • djblets.log
  • djblets.log.middleware
  • djblets.log.siteconfig
  • djblets.log.urls
  • djblets.log.views
  • djblets.mail.dmarc
  • djblets.mail.message
  • djblets.mail.testing
  • djblets.mail.utils
  • djblets.markdown
  • djblets.markdown.extensions.escape_html
  • djblets.markdown.extensions.wysiwyg
  • djblets.markdown.extensions.wysiwyg_email
  • djblets.pipeline.compilers.es6.ES6Compiler
  • djblets.pipeline.compilers.less.LessCompiler
  • djblets.privacy.consent
  • djblets.privacy.consent.base
  • djblets.privacy.consent.common
  • djblets.privacy.consent.errors
  • djblets.privacy.consent.forms
  • djblets.privacy.consent.hooks
  • djblets.privacy.consent.registry
  • djblets.privacy.consent.tracker
  • djblets.privacy.models
  • djblets.privacy.pii
  • djblets.privacy.templatetags.djblets_privacy
  • djblets.recaptcha.mixins
  • djblets.recaptcha.siteconfig
  • djblets.recaptcha.templatetags.djblets_recaptcha
  • djblets.recaptcha.widgets
  • djblets.registries
  • djblets.registries.errors
  • djblets.registries.importer
  • djblets.registries.mixins
  • djblets.registries.registry
  • djblets.registries.signals
  • djblets.siteconfig
  • djblets.siteconfig.admin
  • djblets.siteconfig.context_processors
  • djblets.siteconfig.django_settings
  • djblets.siteconfig.forms
  • djblets.siteconfig.managers
  • djblets.siteconfig.middleware
  • djblets.siteconfig.models
  • djblets.siteconfig.signals
  • djblets.siteconfig.views
  • djblets.template.caches
  • djblets.template.context
  • djblets.template.loaders.conditional_cached
  • djblets.template.loaders.namespaced_app_dirs
  • djblets.testing.decorators
  • djblets.testing.testcases
  • djblets.testing.testrunners
  • djblets.urls.context_processors
  • djblets.urls.decorators
  • djblets.urls.patterns
  • djblets.urls.resolvers
  • djblets.urls.root
  • djblets.urls.staticfiles
  • djblets.util.compat.django.core.cache
  • djblets.util.compat.django.core.files.locks
  • djblets.util.compat.django.core.management.base
  • djblets.util.compat.django.core.validators
  • djblets.util.compat.django.shortcuts
  • djblets.util.compat.django.template.context
  • djblets.util.compat.django.template.loader
  • djblets.util.compat.django.utils.functional
  • djblets.util.compat.python.past
  • djblets.util.contextmanagers
  • djblets.util.dates
  • djblets.util.decorators
  • djblets.util.filesystem
  • djblets.util.html
  • djblets.util.http
  • djblets.util.humanize
  • djblets.util.json_utils
  • djblets.util.properties
  • djblets.util.serializers
  • djblets.util.templatetags.djblets_deco
  • djblets.util.templatetags.djblets_email
  • djblets.util.templatetags.djblets_forms
  • djblets.util.templatetags.djblets_images
  • djblets.util.templatetags.djblets_js
  • djblets.util.templatetags.djblets_utils
  • djblets.util.views
  • djblets.views.generic.base
  • djblets.views.generic.etag
  • djblets.webapi.auth
  • djblets.webapi.auth.backends
  • djblets.webapi.auth.backends.api_tokens
  • djblets.webapi.auth.backends.base
  • djblets.webapi.auth.backends.basic
  • djblets.webapi.auth.backends.oauth2_tokens
  • djblets.webapi.auth.views
  • djblets.webapi.decorators
  • djblets.webapi.encoders
  • djblets.webapi.errors
  • djblets.webapi.fields
  • djblets.webapi.managers
  • djblets.webapi.models
  • djblets.webapi.oauth2_scopes
  • djblets.webapi.resources
  • djblets.webapi.resources.base
  • djblets.webapi.resources.group
  • djblets.webapi.resources.registry
  • djblets.webapi.resources.root
  • djblets.webapi.resources.user
  • djblets.webapi.resources.mixins.api_tokens
  • djblets.webapi.resources.mixins.forms
  • djblets.webapi.resources.mixins.oauth2_tokens
  • djblets.webapi.resources.mixins.queries
  • djblets.webapi.responses
  • djblets.webapi.signals
  • djblets.webapi.testing
  • djblets.webapi.testing.decorators
  • djblets.webapi.testing.testcases
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers Djblets 2.0. You can select a version above or view the latest documentation.

    djblets.webapi.fields¶

    Representations of field types in the API.

    class BaseAPIFieldType(field_info)[source]¶

    Bases: object

    Base class for a field type for an API.

    This is responsible for defining the requirements of a field and to validate and normalize a value provided by a client of the API, for storage or processing.

    name = None[source]¶

    The localized name of the field type.

    This should be in sentence casing.

    __init__(field_info)[source]¶

    Initialize the field type.

    Subclasses should override this if they need to look up any values from the field information dictionary.

    Parameters:field_info (dict) – Information defined for a field.
    get_value_from_data(name, fields_data, files_data)[source]¶

    Return a value from the data from a request.

    Parameters:
    • name (unicode) – The name of the entry in the API request to retrieve data for.
    • fields_data (dict) – A dictionary of data provided in the request for standard fields. This is usually request.POST or request.GET.
    • files_data (dict) – A dictionary of data provided in the request for uploaded files. This is usually request.FILES.
    Returns:

    The value from one of the dictionaries, or None if not found.

    Return type:

    object

    get_field_info_key(key)[source]¶

    Return the value for a key in the field information dictionary.

    This will return a consistent error if the key is not found.

    Parameters:key (unicode) – The name of the key.
    Returns:The value for the key.
    Return type:object
    Raises:KeyError – The key was not found in the field information dictionary.
    clean_value(value)[source]¶

    Validate and return a normalized result from the given value.

    By default, this just returns the provided value. Subclasses should override this to perform normalization.

    Parameters:value (object) – The value to validate and normalize.
    Returns:The normalized value.
    Return type:object
    Raises:django.core.exceptions.ValidationError – The value is not valid for this field type.
    __str__()[source]¶

    Return a string representation of the field type.

    This should return a string summary suitable for human consumption.

    Returns:A string representation of this field type.
    Return type:unicode
    class NonRequestFieldTypeMixin[source]¶

    Bases: object

    Mixin for field types not intended to handle values from requests.

    clean_value(value)[source]¶

    Validate and return a normalized string result from a value.

    Parameters:value (object) – The value to normalize.
    Raises:NotImplementederror – An error describing that this field type cannot be used with request data.
    class BooleanFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for boolean values.

    name = u'Boolean'[source]¶
    clean_value(value)[source]¶

    Validate and return a boolean result from a value.

    This treats 1, "1", True, or "true" (case-insensitive) as truthy values, and everything else as a falsy value.

    Parameters:value (object) – The value to normalize.
    Returns:The normalized boolean value.
    Return type:unicode
    class ChoiceFieldType(*args, **kwargs)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for a fixed choice of strings.

    This takes a choices key in the field information dictionary, which specifies a list of values accepted during validation.

    name = u'Choice'[source]¶
    __init__(*args, **kwargs)[source]¶

    Initialize the field type.

    Parameters:
    • *args (tuple) – Positional arguments for the parent constructor.
    • **kwargs (dict) – Keyword arguments for the parent constructor.
    Raises:

    KeyError – The “choices” key was not found in the field information.

    clean_value(value)[source]¶

    Validate and return a normalized result from the given value.

    This will return the value if it’s a valid choice.

    Parameters:value (object) – The value to validate and normalize.
    Returns:The value, if it’s a valid choice.
    Return type:object
    Raises:django.core.exceptions.ValidationError – The value is not one of the valid choices.
    __str__()[source]¶

    Return a string representation of the field type.

    Returns:A string representation of this field type.
    Return type:unicode
    class DateTimeFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for representing date/times in ISO 8601 format.

    name = u'ISO 8601 Date/Time'[source]¶
    clean_value(value)[source]¶

    Validate and return a datetime from an ISO 8601 value.

    Parameters:value (object) – The value to validate and normalize. This should be a datetime.datetime or an ISO 8601 date/time string.
    Returns:The resulting date/time value.
    Return type:datetime.datetime
    Raises:django.core.exceptions.ValidationError – The resulting value was not a valid ISO 8601 date/time string or the time was ambiguous.
    class DictFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for dictionary-based values.

    name = u'Dictionary'[source]¶
    clean_value(value)[source]¶

    Validate and return a dictionary from a dictionary or JSON value.

    Parameters:value (object) – The value to validate and normalize. This should be a dict or JSON string representing a dictionary.
    Returns:The resulting dictionary value.
    Return type:dict
    Raises:django.core.exceptions.ValidationError – The resulting value was not a dictionary. Either the value provided was of an invalid type or the parsed JSON data did not result in a dictionary.
    class FileFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for uploaded files.

    name = u'Uploaded file'[source]¶
    get_value_from_data(name, fields_data, files_data)[source]¶

    Return a value from the uploaded files from a request.

    Parameters:
    • name (unicode) – The name of the entry in the API request to retrieve data for.
    • fields_data (dict, unused) – A dictionary of data provided in the request for standard fields. This is usually request.POST or request.GET.
    • files_data (dict) – A dictionary of data provided in the request for uploaded files. This is usually request.FILES.
    Returns:

    The value from files_data, or None if not found.

    Return type:

    django.core.files.uploadedfile.UploadedFile

    class IntFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for integer values.

    name = u'Integer'[source]¶
    clean_value(value)[source]¶

    Validate and return an integer for a given value.

    Parameters:value (object) – The value to validate and normalize.
    Returns:The resulting integer value.
    Return type:int
    Raises:django.core.exceptions.ValidationError – The value is not a valid integer.
    class ListFieldType(*args, **kwargs)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for list-based values.

    This takes an optional items key in the field information dictionary, which is itself a field information dictionary for the type of item in the list. If provided, all values in a JSON list in the request payload will be cleaned using that item type. If not provided, the list will be allowed as-is.

    name = u'List'[source]¶
    __init__(*args, **kwargs)[source]¶

    Initialize the field type.

    Parameters:
    • *args (tuple) – Positional arguments for the parent constructor.
    • **kwargs (dict) – Keyword arguments for the parent constructor.
    clean_value(value)[source]¶

    Validate and return a list from a list or JSON value.

    Parameters:

    value (object) – The value to validate and normalize. This should be a list or JSON string representing a list.

    Returns:

    The resulting list of optionally-cleaned items.

    Return type:

    list

    Raises:

    django.core.exceptions.ValidationError – This will be raised if the resulting value was not a dictionary. Either the value provided was of an invalid type or the parsed JSON data did not result in a dictionary.

    It may also be raised through the list item type’s validation.

    __str__()[source]¶

    Return a string representation of the field type.

    Returns:A string representation of this field type.
    Return type:unicode
    class ResourceFieldType(*args, **kwargs)[source]¶

    Bases: djblets.webapi.fields.NonRequestFieldTypeMixin, djblets.webapi.fields.BaseAPIFieldType

    A field type for referencing a resource.

    This is intended purely for the Resource.fields list, for the purpose of documentation. It’s generally not considered safe to let a client specify information like resources in a request. If needed, subclasses can override clean_value() to safely handle client requests.

    This expects a “resource” key in the field information. It can point to a resource class or instance, or a string path pointing to one.

    name = u'Resource'[source]¶
    __init__(*args, **kwargs)[source]¶

    Initialize the field type.

    Parameters:
    • *args (tuple) – Positional arguments for the parent constructor.
    • **kwargs (dict) – Keyword arguments for the parent constructor.
    Raises:
    • ImportError – The resource class could not be imported.
    • KeyError – The “resource” key was not found in the field information.
    __str__()[source]¶

    Return a string representation of the field type.

    Returns:A string representation of this field type.
    Return type:unicode
    class ResourceListFieldType(*args, **kwargs)[source]¶

    Bases: djblets.webapi.fields.ResourceFieldType

    A field type for referencing a list of a type of resource.

    This is intended purely for the Resource.fields list, for the purpose of documentation. It’s generally not considered safe to let a client specify information like resources in a request. If needed, subclasses can override clean_value() to safely handle client requests.

    This expects a "resource" key in the field information.

    name = u'Resource List'[source]¶
    __str__()[source]¶

    Return a string representation of the field type.

    Returns:A string representation of this field type.
    Return type:unicode
    class StringFieldType(field_info)[source]¶

    Bases: djblets.webapi.fields.BaseAPIFieldType

    A field type for string values.

    name = u'String'[source]¶
    clean_value(value)[source]¶

    Validate and return a normalized string result from a value.

    Parameters:value (object) – The value to normalize.
    Returns:A string version of the value.
    Return type:unicode

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]