add some new data to device login data, first part of broker to stake holders assignment

This commit is contained in:
2025-08-27 17:04:55 +03:30
parent 65c831d6a8
commit 680a469839
18 changed files with 167 additions and 46 deletions

View File

@@ -2,6 +2,7 @@ from django.db import models
from django.conf import settings
from crum import get_current_user
from django.contrib.auth.models import AnonymousUser
from .manager import SoftDeleteManager
class BaseModel(models.Model):
@@ -24,6 +25,12 @@ class BaseModel(models.Model):
creator_info = models.CharField(max_length=100, null=True)
modifier_info = models.CharField(max_length=100, null=True)
trash = models.BooleanField(default=False)
objects = SoftDeleteManager() # filter all records with trash=False
all_objects = SoftDeleteManager().all_with_deleted() # get all records
def soft_delete(self):
self.trash = True
self.save(update_fields=['trash'])
class Meta:
abstract = True