def get_partition_names(self, model):
        current = model._partition_manager.current_partition_key
        next = model._partition_manager.next_partition_key
        current_only = self.options.get('current_only')
        next_only = self.options.get('next_only')

        if current_only and next_only:
            raise CommandError(
                u'You cannot specify current_only and next_only togethers')

        try:
            partition_names = [self.args[1]]
        except __HOLE__:
            partition_names = None

        if current_only:
            partition_names = [current()]
        elif next_only:
            partition_names = [next()]
        elif not partition_names:
            # No explicit partition names given, use current and next
            partition_names = [current(), next()]

        return partition_names
dataset/ETHPy150Open danfairs/django-parting/parting/management/commands/ensure_partition.py/Command.get_partition_names