コード例 #1
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    def getUserContents(self):
        selection = myDB.selectRows("user_content")

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

        return selection
コード例 #2
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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
コード例 #3
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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
コード例 #4
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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
コード例 #5
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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
コード例 #6
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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
コード例 #7
0
ファイル: database.py プロジェクト: sahnerkin/media-logbook
    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