Adds a field to the record.
add_field((str)field_name, (FieldType)field_type, (int)size=0,
(int)scale=0, (str)source='', (str)description='') -> Field :
add_field((Field)field) -> Field :
Returns the generated Field. Use the return value to access the new field.
Returned field names
This method may change the name of your field to prevent conflicts. You should capture the return value rather than subsequently searching for this field by name.
- field_name: The name of the new field.
- field_type: The type of the new field.
- size: An option to set the number of characters for strings or the size in bytes for blob or spatial types. This option is ignored for primitive types.
- scale An option to set the scaling factor for fixed decimals. This option is ignored for all other data types.
- source: The source string in the field metadata.
- description: The description string in the field metadata.
- field object: The object to be added to the record.