def get(self, publisher_name, collection_name): publisher = Publisher.get_by_urlname(publisher_name) collection = Collection.get_by_urlname(collection_name, publisher.key) response = dict( publisher=simplejson.loads(publisher.json), collection=simplejson.loads(collection.json)) self.response.headers["Content-Type"] = "application/json" self.response.out.write(simplejson.dumps(response))
def get(self, publisher_name): publisher = Publisher.get_by_urlname(publisher_name) collections = Collection.all_by_publisher(publisher.key) response = dict( publisher=simplejson.loads(publisher.json), collections=[simplejson.loads(x.json) for x in collections]) self.response.headers["Content-Type"] = "application/json" self.response.out.write(simplejson.dumps(response))
def get(self, publisher_name, collection_name): publisher = Publisher.get_by_urlname(publisher_name) collection = Collection.get_by_urlname(collection_name, publisher.key) logging.info(str(collection)) records = Record.all_by_collection(collection.key) response = dict( publisher=simplejson.loads(publisher.json), collection=simplejson.loads(collection.json), records=[simplejson.loads(x.record) for x in records]) self.response.headers["Content-Type"] = "application/json" self.response.out.write(simplejson.dumps(response))