MMpy.DataGridBuilder
Syntax
class ExampleClass(MMpy.DataGridBuilder)
Description
Wrapper around the MMpy.DataGrid 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.DataGrid
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 both rows and cells (through double indexing).
See below for an example on how to use this.
Introduced in v2020.
Examples
formset = MMpy.Formset(...) class DataGrid0(MMpy.DataGridBuilder): _VERSION = 1 _COLUMNS = { 'ExampleColumnName': ... (auto generated by recorder) ... } def __init__(self): self[0] = ['example1', '6', 'example2', ''] grid = DataGrid0() grid[1] = ['example3', '10', 'example4', ''] grid[0]['ExampleColumnName'] = 'example5' mmpy_grid = grid.build() # Type is now MMpy.DataGrid, you can no longer modify values with the Python syntax like above. formset.set_field('GRID', mmpy_grid)
Resource ID
IDPH_DATAGRIDBUILDER