Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
ProtoRPC is an experimental, innovative, and rapidly changing new feature for App Engine. Unfortunately, being on the bleeding edge means that we may make backwards-incompatible changes to ProtoRPC. We will inform the community when this feature is no longer experimental.
The Field class is the base class for all fields defined on messages. This class cannot be extended by developers.
Field
is provided by the protorpc.messages
module.
The constructor of the Field class is defined as follows:
Initializes an Field instance. Each sub-class of Field must define the following:
VARIANTS
DEFAULT_VARIANT
Arguments:
repeated
argument; do not specify repeated
if you use required
.required
argument; do not specify required=True
if you also use repeated=True
.
descriptor.proto
. Best practice is to use default values, but you can specify values as 32-bit, 64-bit, unsigned, etc.Note: Default values are not permitted for repeated fields or message fields.
Raises the following exceptions:
The FieldList class has one property:
FieldList instances have the following methods:
Arguments:
Raises a ValidationError if the value is not an expected type.
Validates a value assigned to a default field. Specific to a single element.
Some fields may allow for delayed resolution of default types necessary in the case of circular definition references. In this case, the default value might be a placeholder that is resolved when needed after all the message classes are defined.
Arguments:
Raises a ValidationError if the value is not an expected type.
Validates that a field's default value.
Arguments:
Raises a ValidationError if the value is not an expected type.
Gets a message definition that contains this Field definition. Returns a definition for the Message object that contains the Field. Returns None if Field is defined outside of a message class.
Raises a ValidationError if the value is not an expected type.