maxtepkeev/django-db-parti — pull request #3 by kmitrovic (2014-01-24 16:19:42+00:00)
Title: Exception when used on columns with auto_now_add or auto_now set

As columns with either of those two options set are not supported by this plugin, within the init method of the Partitionable class a check is added that will test both those properties of the column that is used for partitioning. If either property is set (to True), PartitionAutoDateColumnError exception will be raised with appropriate message.

So far, this case was producing confusing PartitionRangeError exception with a note that (for example) 'week' is not within list ['day', 'week', ...], as AttributeError exception was raised by following line:

return getattr(self, '_get_{}_period'.format(self.period))()

(within, self.now was None - unset yet in auto_now_add=True case, so self.now.year raised that mentioned exception).