gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
26
core/apps/eggs/models/monitoring.py
Normal file
26
core/apps/eggs/models/monitoring.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
|
||||
from core.http.models import User
|
||||
|
||||
|
||||
class Monitoring(models.Model):
|
||||
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = GenericForeignKey("content_type", "object_id")
|
||||
action = models.CharField(max_length=255)
|
||||
user_id = models.ForeignKey(
|
||||
to=User, on_delete=models.CASCADE, related_name="monitoring"
|
||||
)
|
||||
timestamp = models.DateTimeField(auto_now_add=True)
|
||||
created_by = models.CharField(max_length=255, null=True, blank=True)
|
||||
created_who = models.CharField(max_length=255, null=True, blank=True)
|
||||
comment = models.CharField(max_length=255, null=True, blank=True)
|
||||
reason = models.CharField(max_length=255, null=True, blank=True)
|
||||
price = models.DecimalField(
|
||||
max_digits=30, decimal_places=2, default=0, null=True, blank=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ["-timestamp"]
|
||||
Reference in New Issue
Block a user