diff --git a/src/djinit/templates/components/base.py-tpl b/src/djinit/templates/components/base.py-tpl new file mode 100644 index 0000000..5108722 --- /dev/null +++ b/src/djinit/templates/components/base.py-tpl @@ -0,0 +1,11 @@ +"""generated with djinit""" + +from django.db import models + + +class TimeStampedModel(models.Model): + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + class Meta: + abstract = True diff --git a/src/djinit/utils/django.py b/src/djinit/utils/django.py index 2402e22..66e5ea7 100644 --- a/src/djinit/utils/django.py +++ b/src/djinit/utils/django.py @@ -71,6 +71,7 @@ class DjangoHelper: ("urls.py", "config/urls.py-tpl", urls_context), ("wsgi.py", "config/wsgi.py-tpl", {"project_name": project_name}), ("asgi.py", "config/asgi.py-tpl", {"project_name": project_name}), + ("base.py", "components/base.py-tpl", {}), ] CommonUtils.create_files_from_templates(project_config_dir, project_files, f"{project_name}/")