Skip to main content

system.kanoa.inventory.getModelBom(modelId)

Returns the fully flattened Bill-of-Materials for an equipment model, given its modelId. Because model BOM items can reference nested child models (see addModelBomItem), "flattened" means the returned dataset resolves the entire multi-level structure into a single flat list of rows, rather than requiring the caller to recursively walk parent/child BOM relationships.


Parameters

modelId Integer


Returns

data pyDataset


Example

# Full flattened BOM for a model
modelId = 3
data = system.kanoa.inventory.getModelBom(modelId)
data = system.kanoa.utilities.convertDatasetToJSON(data)

for i, row in enumerate(data):
print 'Row %i'%i
for k,v in row.items():
print k,v

break #Just limiting to returning the columns from the first record for display purposes
>>>
Row 0
quantity 1.0
uomCode EA
notes None
modelId 3
partId 16
manufacturerName Parker
manufacturerId 5
positionCode None
enabled True
modelBomId 14
modelDescription Parker FH-200-SS Stainless Filling Head 200ml/s
positionName Nozzle Actuator
path FH-200-SS
depth 1
parentBomId None
partDescription Festo Pneumatic Cylinder 50mm x 100mm stroke
uomName Each
modelNumber FH-200-SS
sourceModelNumber None
partNumber CYL-FESTO-50x100
partCategoryPath Pneumatics
>>>