Example #1
0
def createBoard(userId):
    couch = couchdb.Server()
    myUserdb = couch['userdb']
    print myUserdb

    if userId in myUserdb:
        bname=request.POST.get('boardName')
        bdesc = request.POST.get('boardDesc')
        category=request.POST.get('category')
        boardType=request.POST.get('isPrivate')

        global storage
        storage = Storage()
        boardId = storage.insertBoard(userId,bname,bdesc,category,boardType)
        return boardId
    else:
        return "User not Authorized!"
Example #2
0
def createBoard(id):
    print '--in moo.createBoard'
    user_id = request.forms.get("id")
    print "id", user_id

    couch = couchdb.Server()
    mydb = couch['userdb']
    #doc = mydb[user_id]
    if user_id in mydb:
        bname = request.POST.get('boardName')
        bdesc = request.POST.get('boardDesc')
        category = request.POST.get('category')
        boardType = request.POST.get('isPrivate')

        global storage
        storage = Storage()
        boardId = storage.insertBoard(user_id, bname, bdesc, category, boardType)
        return boardId
    else:
        return "User not Authorized!"