class CreateRangeVoteCommand():
    def __init__(self, uuid, question, choices):
        self.uuid = uuid
        self.question = question
        self.choices = choices


class CreateRangeVoteCommandValidator():
    def __init__(self, data):
        self.data = data

    def is_valid(self):
        if 'question' not in self.data or 'choices' not in self.data:
            return False
        if len(self.data['choices']) < 2:
            return False
        return True
import logging

logger = logging.getLogger(__name__)


class CreateRangeVoteCommand():
    def __init__(self, uuid, question, choices):
        self.uuid = uuid
        self.question = question
        self.choices = choices


class CreateRangeVoteCommandValidator():
    def __init__(self, data):
        self.data = data

    def is_valid(self):
        if 'question' not in self.data or 'choices' not in self.data:
            logger.debug('CreateRangeVoteCommandValidator : question or choices not in rangevote')
            return False
        if len(self.data['choices']) < 2:
            logger.debug('CreateRangeVoteCommandValidator : should have at least two choices in rangevote')
            return False
        return True
add log to command