def create_board(request): if request.POST: form = BoardForm(request.POST) if form.is_valid(): new_board = Board() new_board.save() welcomePostit = PostIt(text=_("Welcome! Move me! Edit me! Delete me!"),x=120,y=50, board=new_board, width=100, height=100) sharePostit = PostIt(text=_("Share this board and work together in realtime!")+ "\n\nhttp://www.boardino.com/"+new_board.hash, x=200, y=300, board=new_board, width=220, height=100, back_color='#FF69B4') comeBackPostit = PostIt(text=_("Come back to check new features!"),x=550,y=50, board=new_board, width=150, height=100, back_color='#ADFF2F') welcomePostit.save() sharePostit.save() comeBackPostit.save() return HttpResponseRedirect("/"+new_board.hash) return HttpResponseRedirect("/")
def create_board(request): new_board = Board() new_board.save() welcomePostit = PostIt(text="Welcome! Move me! Edit me! Delete me!",x=120,y=50, board=new_board, width=100, height=100) sharePostit = PostIt(text="Share this board and work together in realtime!\n\nhttp://www.boardino.com/"+str(new_board.id), x=200, y=300, board=new_board, width=220, height=100, back_color='#FF69B4') comeBackPostit = PostIt(text="Come back to check new features!",x=550,y=50, board=new_board, width=150, height=100, back_color='#ADFF2F') welcomePostit.save() sharePostit.save() comeBackPostit.save() return HttpResponseRedirect("/"+str(new_board.id))