- @staticmethod
- def from_dict(pod_dict):
- if pod_dict is None:
- return None
-
- p = Pod()
- p._id = pod_dict.get('_id')
- p.creation_date = str(pod_dict.get('creation_date'))
- p.name = pod_dict.get('name')
- p.mode = pod_dict.get('mode')
- p.details = pod_dict.get('details')
- p.role = pod_dict.get('role')
- return p
-
- def format(self):
- f = super(Pod, self).format()
- f['creation_date'] = str(self.creation_date)
- return f
-
- def format_http(self):
- f = self.format()
- f['_id'] = str(self._id)
- return f
-