• Ayush Tiwari's avatar
    erp5_dat_notebook bt5: Do not save modules object in local_variable_dict · 677da4a0
    Ayush Tiwari authored
    Problem: Module objects are not picklable, thus, trying them to save in
    local_variable_dict which is further saved in ZODB via ActiveResult object
    of CMFActivity was giving error. So, its better to save the module objects
    as code_strings in local_variable_dict.
    
    As for now, for example:
    local_variable_dict = {'imports': ['import numpy as np', 'import matplotlib as mpl'],
    			 'variables': {'a':1, 'b:2'}}
    for jupyter_code = """
    import numpy as np
    import matplotlib as mlp
    a= 1; b=2; print a+b
    """
    677da4a0
extension.erp5.JupyterCompile.xml 3.7 KB