Esempio n. 1
0
    def getUserContents(self):
        selection = myDB.selectRows("user_content")

        if selection is None or len(selection) == 0:
            return None

        return selection
Esempio n. 2
0
    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
Esempio n. 3
0
    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
Esempio n. 4
0
    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
Esempio n. 5
0
    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
Esempio n. 6
0
    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
Esempio n. 7
0
    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