Skip to content

Commit

Permalink
Cleanup and add series name.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuykendall committed Apr 14, 2016
1 parent 64e4ab1 commit 519e70f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion marvelous/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ def api(public_key=None, private_key=None, cache=False):
"not yet on pypi. To install the newest requests-cache, run "
"`pip install requests-cache`.")


return Session(public_key, private_key, cached_requests=cache)
17 changes: 14 additions & 3 deletions marvelous/comic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,24 @@ class ComicSchema(Schema):
issn = fields.Str()
format = fields.Str()
pageCount = fields.Int(attribute='page_count')
dates = fields.Nested(DatesSchema)
# textObjects
# resourceURI
# urls
series = fields.Nested(SeriesSchema)
# variants
# collections
# collectedIssues
dates = fields.Nested(DatesSchema)
# prices
# thumbnail
# images
# creators
# characters
# stories
# events

@pre_load
def process_input(self, data):
# print data.keys()
# raise hell
return data

@post_load
Expand Down
4 changes: 1 addition & 3 deletions marvelous/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ class SeriesSchema(Schema):
response = fields.Raw()
id = fields.Int()
resourceURI = fields.Str(attribute='resource_uri')
name = fields.Str()

@pre_load
def process_input(self, data):
# print data.keys()

if 'status' in data:
data['data']['results'][0]['response'] = data
data = data['data']['results'][0]
Expand All @@ -34,5 +33,4 @@ def process_input(self, data):

@post_load
def make(self, data):
# print data.keys()
return Series(**data)

0 comments on commit 519e70f

Please sign in to comment.