def to_internal_value(self, value):
        try:
            year, month = [int(el) for el in value.split('.')]
        except __HOLE__:
            raise serializers.ValidationError('Value "{}" should be valid be in format YYYY.MM'.format(value))
        if not 0 < month < 13:
            raise serializers.ValidationError('Month has to be from 1 to 12')
        return year, month
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/cost_tracking/serializers.py/YearMonthField.to_internal_value