2021-01-04 13:07:29 +11:00
|
|
|
class Data:
|
|
|
|
|
products = {}
|
|
|
|
|
|
2021-02-03 17:30:19 +11:00
|
|
|
@classmethod
|
|
|
|
|
def purge(cls):
|
|
|
|
|
cls.products = {}
|
|
|
|
|
|
2021-01-04 13:07:29 +11:00
|
|
|
@classmethod
|
2021-03-25 10:48:31 +11:00
|
|
|
def load(cls, file, product_id):
|
2021-01-04 13:07:29 +11:00
|
|
|
if not file:
|
|
|
|
|
return
|
|
|
|
|
product = file.by_id(product_id)
|
|
|
|
|
cls.products[product_id] = {
|
|
|
|
|
"type": product.is_a(),
|
|
|
|
|
"PredefinedType": product.PredefinedType if hasattr(product, "PredefinedType") else None,
|
2021-01-05 13:16:31 +11:00
|
|
|
"ObjectType": product.ObjectType if hasattr(product, "ObjectType") else None
|
2021-01-04 13:07:29 +11:00
|
|
|
}
|