コード例 #1
0
    def get_char_times(char_id):
        try:
            board = MongoPlunderBoard.objects.get(id=char_id)
        except DoesNotExist:
            board = MongoPlunderBoard(id=char_id)
            board.times = 0
            board.save()

        return board.times
コード例 #2
0
ファイル: plunder.py プロジェクト: yueyoum/sanguo-server
    def get_char_times(char_id):
        try:
            board = MongoPlunderBoard.objects.get(id=char_id)
        except DoesNotExist:
            board = MongoPlunderBoard(id=char_id)
            board.times = 0
            board.save()

        return board.times
コード例 #3
0
    def incr(char_id, times=1):
        try:
            board = MongoPlunderBoard.objects.get(id=char_id)
        except DoesNotExist:
            board = MongoPlunderBoard(id=char_id)
            board.times = 0

        board.times += times
        board.save()
コード例 #4
0
ファイル: plunder.py プロジェクト: yueyoum/sanguo-server
    def incr(char_id, times=1):
        try:
            board = MongoPlunderBoard.objects.get(id=char_id)
        except DoesNotExist:
            board = MongoPlunderBoard(id=char_id)
            board.times = 0

        board.times += times
        board.save()