Models#

class abstract.models.BaseModel(*args, **kwargs)[source]#

This is the base class model for all models of the database tables.

Attributes:

operating_user (object): The user operating on the model instance. objects (BaseManager): The custom manager for BaseModel instances. status (bool): Status of the record (active or not), default is True. created_at (DateTime): Datetime of creation, auto-generated. updated_at (DateTime): Last modification datetime, auto-updated. created_by (ForeignKey): User who created the record. updated_by (ForeignKey): User who last updated the record.

Usage:
class <CLASS_NAME>(BaseModel):

# model definition

class Meta[source]#

Meta class to specify metadata options for the BaseModel.

delete(*args, **kwargs)[source]#

Override delete method to set status to False instead of actual deletion.

save(*args, **kwargs)[source]#

Save method overridden to set created_by and updated_by fields.