CustomBaseModel

class database.models.CustomBaseModel(*args, **kwargs)

Bases: django.db.models.base.Model

Base model that containing fields and functionality used in all models.

date_created

models.DateTimeField – The date this entry was created

date_updated

models.DateTimeField – The date this entry was updated

Attributes Summary

date_created A wrapper for a deferred-loading field.
date_updated A wrapper for a deferred-loading field.
display_name Alias for the __str()__ method, useful for templates.

Methods Summary

get_absolute_url() Get the absolute URL for an instance of a model.
get_fields_and_properties() List the public fields and properties of a model.
get_next_by_date_created(*[, field, is_next])
get_next_by_date_updated(*[, field, is_next])
get_previous_by_date_created(*[, field, is_next])
get_previous_by_date_updated(*[, field, is_next])
get_verbose_name_plural() Get a human friendly plural name of a model.
save(*args, **kwargs) Ensure that the full_clean() method is called before saving.

Attributes Documentation

date_created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

date_updated

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

display_name

Alias for the __str()__ method, useful for templates.

Methods Documentation

get_absolute_url() → str

Get the absolute URL for an instance of a model.

classmethod get_fields_and_properties() → List[str]

List the public fields and properties of a model.

Returns:fields_and_properties – A list of strings representing the public fields and properties of this model.
Return type:List[str]
get_next_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=True, **kwargs)
get_next_by_date_updated(*, field=<django.db.models.fields.DateTimeField: date_updated>, is_next=True, **kwargs)
get_previous_by_date_created(*, field=<django.db.models.fields.DateTimeField: date_created>, is_next=False, **kwargs)
get_previous_by_date_updated(*, field=<django.db.models.fields.DateTimeField: date_updated>, is_next=False, **kwargs)
classmethod get_verbose_name_plural() → str

Get a human friendly plural name of a model.

save(*args, **kwargs) → None

Ensure that the full_clean() method is called before saving.