mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-11-09 04:38:49 +00:00
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:
1 parent
8f41b38bbf
commit
cd7d7c303a
3 files changed
+67
-1
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user