def getUserContents(self): selection = myDB.selectRows("user_content") if selection is None or len(selection) == 0: return None return selection
def getBook(self, book_id): condition = "book_id = '{}'".format(book_id) selection = myDB.selectRows("book", condition) if selection is None or len(selection) == 0: return None bookRow = selection[0] return bookRow
def getGenresFor(self, content_id): condition = "content_id = '{}'".format(content_id) selection = myDB.selectRows("content_genre", condition) if selection is None or len(selection) == 0: return None cgRow = selection return cgRow
def getUserContent(self, user_id, content_id): condition = "user_id = '{}' AND content_id = '{}'".format( user_id, content_id) selection = myDB.selectRows("user_content", condition) if selection is None or len(selection) == 0: return None ucRow = selection[0] return ucRow
def getUserByUsername(self, username): username = username.replace("'", "''") condition = "username = '******'".format(username) selection = myDB.selectRows("user_table", condition) if selection is None or len(selection) == 0: return None userRow = selection[0][0] return userRow
def getContent(self, content_id): condition = "content_id = '{}'".format(content_id) selection = myDB.selectRows("content", condition) if selection is None or len(selection) == 0: return None contentRow = selection[0] return contentRow
def getUser(self, user_id): condition = "user_id = '{}'".format(user_id) selection = myDB.selectRows("user_table", condition) if selection is None or len(selection) == 0: return None userRow = selection[0] return userRow