OEFieldBase

class OEFieldBase

The OEFieldBase class is a base class for a number of specialized classes used to set and get data from OERecord objects. These objects are returned from the OEField function and are not constructed directly.

Constructors

OEFieldBase()

The default constructor initializes the field object to an invalid field with no name or type.

OEFieldBase(rhs: OEFieldBase)

Copy constructor.

get_name

get_name() -> string

Returns the field’s name.

set_name

set_name(name: str) -> None

Sets the name of the field.

get_type_name

get_type_name() -> string

Returns the name of the field’s type.

is_nullable

is_nullable() -> bool

Returns True if the field allows setting of null values.

get_read_only

get_read_only() -> bool

Returns True if the field only allows reading, but not writing, of data onto a record.

is_valid

is_valid() -> bool

Returns True if the field has been initialized.

get_meta

get_meta() -> OEFieldMeta

Returns the metadata associated with this field. If the field has no metadata, an empty OEFieldMeta object is returned.

set_meta

set_meta(meta: OEFieldMeta) -> None

Sets metadata for this field.

See also

OEField

OEField(name: str, dataType: OEFieldType, meta: OEFieldMeta, read_only: bool=False, nullable: bool=False) -> field object of specific type

In Python, OEField is a factory function returning a field object derived from OEFieldBase. The returned field object can be used to set/get values on an OERecord.

name
The name to be given to the created field.
dataType
The type of field to create. Supported types come from the Types namespace.
meta
An OEFieldMeta object containing metadata for the returned field.
read_only
If True, the returned field can only be used for reading from, and not writing to, OERecord objects.
nullable
If True, the returned field can be used to set null values onto an OERecord.

The returned field object will have the following methods inherited from OEFieldBase:

get_name set_name
get_type_name is_nullable
get_read_only is_valid
get_meta set_meta

See also

get_type

get_type() -> OEFieldType

Returns an OEFieldType object representing the type of objects stored and retrieved by this field.

OEMatchField

class OEMatchField

OEMatchField is a factory function returning a specialized match field object. The returned match field is used to retrieve values from an OERecord object when the name of the field is unknown. An OEMatchField object acts as a surrogate for the first field of a record that matches the type and metadata.

OEMatchField(name: str, meta: OEFieldMeta, read_only: bool=False, nullable: bool=False)
name
The name to be given to the created match field. It is only used if the match field is used to create a new field on a record.
meta
An OEFieldMeta object containing metadata for the returned match field.
read_only
If True, the returned match field can only be used for reading from, and not writing to, OERecord objects.
nullable
If True, the returned match field can be used to set null values onto an OERecord.

See also