J-O Eriksson 3/10/2020

A model template in your Django app

Read Original

This technical tutorial explains how to implement an abstract base model in Django to avoid repeating common DateTimeFields (e.g., 'added' and 'edited') across multiple models. It demonstrates creating a TimeStampedModel with abstract=True and shows how to inherit from it to keep your code DRY and maintainable.

A model template in your Django app

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week