当前位置: 首页>>代码示例>>Python>>正文


Python Storage.getBoardId方法代码示例

本文整理汇总了Python中data.storage.Storage.getBoardId方法的典型用法代码示例。如果您正苦于以下问题:Python Storage.getBoardId方法的具体用法?Python Storage.getBoardId怎么用?Python Storage.getBoardId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data.storage.Storage的用法示例。


在下文中一共展示了Storage.getBoardId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: updatePin

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def updatePin(userId,boardName,pinId):

    couch = couchdb.Server()
    mydb = couch['userdb']
    board = couch['boards']
    pin=couch['pinsdb']
    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)

    if userId in mydb:
        if bId in board:
            if pinId in pin:
                pname = request.POST.get('pinName')
                pdesc = request.POST.get('pinDesc')
                image = request.POST.get('image')

                boardId = storage.updatePin(userId,bId, pinId,pname, pdesc,image )
                return boardId
            else:
                return "Invalid Pin Id!"
        else:
            return "Invalid Board Id!"
    else:
        return "User not authorized"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:27,代码来源:moo.py

示例2: deleteComment

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def deleteComment(userId,boardName,pinId):
    print
    '--in moo.deleteComment'
    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)
    couch = couchdb.Server()
    mydb = couch['userdb']
    board = couch['boards']
    pins= couch ['pinsdb']
    if userId in mydb:
        if bId in board:
            if pinId in pins:

               # desc=request.POST.get('description')

                #print desc
                global storage
                storage = Storage()
                pinId = storage.deleteComment(userId,bId,pinId)
                return pinId
            else:
                return "Pin not found!"

        else:
            return "Board not Found!"
    else:
        return "User Not Authorized!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:30,代码来源:moo.py

示例3: deleteBoard

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def deleteBoard(userId,boardName):
    print '--in moo.deleteBoard'
    couch = couchdb.Server()
    mydb = couch['userdb']
    myboardDB = couch['boards']
    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)

    if userId in mydb:
        if bId in myboardDB:
            boardId = storage.deleteBoard(userId,bId)
        else:
            return "Board not Authorized!"
    else:
        return "User not authorized"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:18,代码来源:moo.py

示例4: getBoardDetails

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def getBoardDetails(userId,boardName):
    print '--in moo.getBoardList'

    couch = couchdb.Server()
    myUserdb = couch['userdb']
    myboardDB = couch['boards']
    storage = Storage()
    bId = storage.getBoardId(boardName)

    if userId in myUserdb:
         if bId in myboardDB:
             doc = storage.viewBoard(bId)
             return doc
         else:
             return "Board Id does not exist"
    else:
        return "User not Authorized!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:19,代码来源:moo.py

示例5: viewAllPin

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def viewAllPin(userId,boardName):
    print
    '--in moo.viewAllPins'
    couch = couchdb.Server()

    board = couch['boards']
    myUserdb = couch['userdb']
    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)

    if id in myUserdb:
        if bId in board:
            doc=storage.viewAllPins(id,bId)
            return doc
        else:
            return "Board Id not Found!"
    else:
        return "User Id Not Found!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:21,代码来源:moo.py

示例6: updateBoard

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def updateBoard(userId,boardName):
    print '--in moo.createBoard'
    global storage
    storage = Storage()
    couch = couchdb.Server()
    mydb = couch['userdb']
    myboardDB = couch['boards']
    bId = storage.getBoardId(boardName)
    if userId in mydb:
        if bId in myboardDB:
            bname = request.POST.get('name')
            bdesc = request.POST.get('boardDesc')
            category = request.POST.get('category')
            boardType = request.POST.get('isPrivate')

            boardId = storage.updateBoard(userId,bId, bname, bdesc, category, boardType)
            return boardId
        else:
            return "Board not Authorized!"
    else:
        return "User not authorized"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:23,代码来源:moo.py

示例7: createPin

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def createPin(userId,boardName):
    print '--in moo.createBoard'
    print "id", userId

    couch = couchdb.Server()
    mydb = couch['userdb']
    board = couch['boards']
    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)
    if userId in mydb:
        if bId in board:
            pname=request.POST.get('pinName')
            pdesc = request.POST.get('pinDesc')
            image=request.POST.get('image')
            pinId = storage.insertPin(userId,boardName,pname,pdesc,image)
            return pinId
        else:
            return "Board not found!"

    else:
        return "User not Found!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:24,代码来源:moo.py

示例8: deletePin

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def deletePin(userId,boardName,pinId):
    print
    '--in moo.viewAllPins'

    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)

    couch = couchdb.Server()
    mydb = couch['userdb']
    board = couch['boards']
    pin = couch['pinsdb']
    if userId in mydb:
        if bId in board:
            if pinId in pin:
               global storage
               storage = Storage()
               storage.deletePin(userId,bId,pinId)
            else:
                return "Pin not found!"
        else:
            return "Board not Found!"
    else:
        return "User Not Found!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:26,代码来源:moo.py

示例9: viewPin

# 需要导入模块: from data.storage import Storage [as 别名]
# 或者: from data.storage.Storage import getBoardId [as 别名]
def viewPin(userId,boardName,pinId):
    print
    '--in moo.viewAllPins'

    couch = couchdb.Server()
    mydb = couch['userdb']
    board = couch['boards']
    pins = couch['pinsdb']

    global storage
    storage = Storage()
    bId = storage.getBoardId(boardName)

    if userId in mydb:
        if bId in board:
            if pinId in pins:
                doc=storage.viewPin(userId,bId,pinId)
                return doc
            else:
                return "Pin not found!"
        else:
            return "Board not Found!"
    else:
        return "User Not Found!"
开发者ID:Rohit-Erande,项目名称:pintrest-like,代码行数:26,代码来源:moo.py


注:本文中的data.storage.Storage.getBoardId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。