'\'Serialize\' to a json-serializable representation.
Returns:
a dictionary with keys for the properties of the partition.'

def to_json(self):

    return {'id': self.id, 'name': self.name, 'scheme': self.scheme.name, 'description': self.description, 'parameters': self.parameters, 'groups': [g.to_json() for g in self.groups], 'active': bool(self.active), 'version': UserPartition.VERSION}
