MMpy.FormSetBuilder

Syntax

class ExampleClass(MMpy.FormSetBuilder)

Description

Wrapper around the MMpy.FormSet object to provide a more object oriented structure, including support for better use of the Python syntax.

This is intended to work as a inherited class. See notes below for more information.

See Also

MMpy.FormSet

Notes

This class is intended to work as a inherited class on a users own class, which is setup through special class attributes.

Using this provides support for direct assignment of values without having to be verbose, which can also be changed easily.

This class supports the __getitem__ and __setitem__ operators on form set fields.

See below for an example on how to use this.

Introduced in v2020.

Examples

class DataGrid0(MMpy.DataGridBuilder):
	...

grid = DataGrid0()
grid[...] = ...

class FormSet0(MMpy.FormSetBuilder):
	_VERSION = '20.0.0.0'
	_CMDID = ...
	_FIELDS = {
		'ExampleField': ... (auto generated by recorder) ...
		'ExampleGrid': ... (auto generated by recorder) ...
	}

	def __init__(self):
		self['ExampleField'] = 'Example.DAT'

formset = FormSet0()
formset['ExampleField'] = 'ANew' + formset['ExampleField']
formset['ExampleGrid'] = grid  # MMpy.DataGridBuilder understands the new object oriented wrapper types directly, no .build() needed.

mmpy_formset = formset.build()  # Type is now MMpy.FormSet, you can no longer modify values with the Python syntax like above.
mmpy_formset.run()

Resource ID

IDPH_FORMSETBUILDER