Beispiel #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
Beispiel #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()