def get_by_address(self, request, address=(str,)): query = Lot.query(Lot.address==address) lot = query.get() if not lot: raise f3.NotFoundException() if not post.key.kind() == 'Lot': raise f3.InvalidRequestException() message = f3.messages.serialize(LotMessage, lot) return message
def list_all(self, request): ''' return list of all posts as a LotMessage ''' lots = Lot.query() if not posts: raise f3.NotFoundException() list_message = f3.messages.serialize_list(LotListMessage, lots) return list_message