def has_book_note(self, username, edition_olid): if not username: return False work_id = extract_numeric_id_from_olid(self.key) edition_id = extract_numeric_id_from_olid(edition_olid) return (len( Booknotes.get_patron_booknote( username, work_id, edition_id=edition_id)) > 0)
def get_users_notes(self, username, edition_olid=None): if not username: return None work_id = extract_numeric_id_from_olid(self.key) edition_id = extract_numeric_id_from_olid( edition_olid) if edition_olid else -1 return Booknotes.get_patron_booknote(username, work_id, edition_id=edition_id)
def get_users_notes(self, username): if not username: return None work_id = extract_numeric_id_from_olid(self.key) return Booknotes.get_patron_booknote(username, work_id)