PRWLR-3997: fix(Models): create BaseModel & TenantModel (#13)

* fix(Models): create BaseModel & TenantModel

* update description to match class

Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>

* fix(Tenants): rename TenantModel to Tenant

---------

Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
This commit is contained in:
Jon YoungandVíctor Fernández Poyatos authored and GitHub committed 2024-07-16 15:44:59 +02:00
1 parent 8f41b38bbf
commit cd7d7c303a
3 files changed
+67 -1

No files matched your search

+23
View File
@@ -1,4 +1,27 @@
from django.db import models
import uuid
class Base(models.Model):
"""
Abstract base model class that provides common fields for all models.
"""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
inserted_at = models.DateTimeField(auto_now_add=True, editable=False)
updated_at = models.DateTimeField(auto_now=True, editable=False)
class Meta:
abstract = True
class Tenant(Base):
"""
The Tenant is the basic grouping in the system. It is used to separate data between customers.
"""
name = models.CharField(max_length=100)
class TestModel(models.Model):