class TimestampedModelBase(): def save(self): if not self.id: self.created_at = datetime.datetime.today() self.updated_at = datetime.datetime.today() models.Model.save(self) def TimestampedModelInit(model_classes): for model_class in model_classes: if issubclass(model_class, TimestampedModelBase): model_class.add_to_class('created_at', models.DateTimeField(editable=False)) model_class.add_to_class('updated_at', models.DateTimeField(editable=False)) model_class.add_to_class('created_by', models.ForeignKey(User)) """ Use: """ class Company(TimestampedModelBase, models.Model): name = models.CharField(maxlength=60) TimestampedModelInit([Company])