Serialize the Properties.

This commit is contained in:
Rowan Cockett
2016-02-09 14:20:44 -08:00
parent ffffcb4b7b
commit 7976e9a498
+8
View File
@@ -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