aboutsummaryrefslogtreecommitdiff
path: root/pandora/models/_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'pandora/models/_base.py')
-rw-r--r--pandora/models/_base.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/pandora/models/_base.py b/pandora/models/_base.py
index 8904be1..c39050b 100644
--- a/pandora/models/_base.py
+++ b/pandora/models/_base.py
@@ -98,8 +98,7 @@ class PandoraModel(metaclass=ModelMetaClass):
98 98
99 @classmethod 99 @classmethod
100 def from_json_list(cls, api_client, data): 100 def from_json_list(cls, api_client, data):
101 """Convert a list of JSON values to a list of models 101 """Convert a list of JSON values to a list of models"""
102 """
103 return [cls.from_json(api_client, item) for item in data] 102 return [cls.from_json(api_client, item) for item in data]
104 103
105 def __init__(self, api_client): 104 def __init__(self, api_client):
@@ -147,15 +146,13 @@ class PandoraModel(metaclass=ModelMetaClass):
147 146
148 @classmethod 147 @classmethod
149 def from_json(cls, api_client, data): 148 def from_json(cls, api_client, data):
150 """Convert one JSON value to a model object 149 """Convert one JSON value to a model object"""
151 """
152 self = cls(api_client) 150 self = cls(api_client)
153 PandoraModel.populate_fields(api_client, self, data) 151 PandoraModel.populate_fields(api_client, self, data)
154 return self 152 return self
155 153
156 def _base_repr(self, and_also=None): 154 def _base_repr(self, and_also=None):
157 """Common repr logic for subclasses to hook 155 """Common repr logic for subclasses to hook"""
158 """
159 items = [ 156 items = [
160 "=".join((key, repr(getattr(self, key)))) 157 "=".join((key, repr(getattr(self, key))))
161 for key in sorted(self._fields.keys()) 158 for key in sorted(self._fields.keys())