mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-27 18:25:42 +08:00
Serialize the Properties.
This commit is contained in:
@@ -12,6 +12,7 @@ class Property(object):
|
||||
# Set the default after all other params are set
|
||||
self.doc = doc
|
||||
Utils.setKwargs(self, **kwargs)
|
||||
self._kwargs = kwargs
|
||||
|
||||
@property
|
||||
def propertyLink(self):
|
||||
@@ -110,6 +111,13 @@ class Property(object):
|
||||
return getattr(self.propMap, '_%sMap'%prop.name, None)
|
||||
return property(fget=fget)
|
||||
|
||||
def toJSON(self):
|
||||
out = dict(doc=self.doc)
|
||||
for k in self._kwargs:
|
||||
out[k] = self._kwargs[k]
|
||||
return out
|
||||
|
||||
|
||||
class PropModel(object):
|
||||
def __init__(self, propMap, vector):
|
||||
self.propMap = propMap
|
||||
|
||||
Reference in New Issue
Block a user