def _get_date_name(self):
        """
        Defines name for a new partition for date partition subtype.
        """
        patterns = {
            'day': {'real': 'y%Yd%j', 'none': 'y0000d000'},
            'week': {'real': 'y%Yw%V', 'none': 'y0000w00'},
            'month': {'real': 'y%Ym%m', 'none': 'y0000m00'},
            'year': {'real': 'y%Y', 'none': 'y0000'},
        }

        try:
            if self.column_value is None:
                pattern = patterns[self.constraint]['none']
            else:
                pattern = self.column_value.strftime(patterns[self.constraint]['real'])
        except __HOLE__:
            raise PartitionConstraintError(
                model=self.model.__name__,
                dialect=self.dialect,
                current=self.constraint,
                allowed=patterns.keys())

        return '{0}_{1}'.format(self.table, pattern)
dataset/ETHPy150Open maxtepkeev/architect/architect/databases/mysql/partition.py/RangePartition._get_date_name