Permalink
Browse files

Added author info to loan stats.

  • Loading branch information...
Anand Chitipothu
Anand Chitipothu committed Dec 6, 2013
1 parent 6041a6e commit 450daeb16b8a6cfcd4270c6e0a323b6ec855f211
Showing with 8 additions and 0 deletions.
  1. +8 −0 openlibrary/solr/process_stats.py
@@ -97,6 +97,13 @@ def get_subjects(self, type="subject"):
else:
return []
+ def get_author_keys(self):
+ w = self.book.works[0]
+ if w:
+ return [a.key for a in w.get_authors()]
+ else:
+ return []
+
@property
def metadata(self):
return get_metadata(self.book.ocaid)
@@ -122,6 +129,7 @@ def process(data):
"type": "stats",
"stats_type_s": "loan",
"book_key_s": doc.book_key,
+ "author_keys_id": doc.get_author_keys(),
"title": doc.book.title or "Untitled",
"ia": doc.book.ocaid or None,
"resource_type_s": doc.resource_type,

0 comments on commit 450daeb

Please sign in to comment.