예제 #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
    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()
예제 #3
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
예제 #4
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()
예제 #5
0
 def clean():
     MongoPlunderBoard.drop_collection()
예제 #6
0
 def clean():
     MongoPlunderBoard.drop_collection()