Abstract Models

This is a collection of abstract django models that can be used as base classes or mixins with your regular django models.

class awl.absmodels.TimeTrackModel(*args, **kwargs)

Abstract model with auto-updating create & update timestamp fields.

Parameters:
  • created – Date/time when the model was created

  • updated – Date/time when the model was last updated

class awl.absmodels.ValidatingMixin(*args, **kwargs)

Include this mixin to force model validation to happen on each save call.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.