Example #1
0
    def previous(self, request, pk=None):
        game = Game.objects.get(pk=pk)

        chess = Chess(game.data)

        chess.previous()

        # update db with new board
        game.data = chess.export()
        game.save()
        return Response("success, time to refresh")