The class derived from rxui.ViewModel is not JSON serializable, and all existing solutions to make a normal class JSON serializable no longer work.
Is there any easy way to make ViewModel derived class serializable?
Or any interface available to retrieve all the XXXProxy properties?
And verse vice:
Is there any easy way to deserialize an instance from json string?
What I want:
from ex4nicegui import rxui
import json
class SystemParameter(rxui.ViewModel):
SF:float = 42.0
RFA:float = 100.0
PW90:float = 10.0
Gx_offset:int = 0
def serialize(self):
with open("syspar.json",'w') as f:
s = json.dumps(self,default=vars)
f.writelines(s)
def deserialize(self,json_str:str):
self = deserialize(json_str)
The class derived from
rxui.ViewModelis not JSON serializable, and all existing solutions to make a normal class JSON serializable no longer work.Is there any easy way to make
ViewModelderived class serializable?Or any interface available to retrieve all the XXXProxy properties?
And verse vice:
Is there any easy way to deserialize an instance from json string?
What I want: