This commit is contained in:
Administrator
2023-09-27 21:58:38 +03:00
parent cdfe18f6b7
commit 9a7581cfdf
17 changed files with 181 additions and 2 deletions

13
stats/models.py Normal file
View File

@@ -0,0 +1,13 @@
from django.db import models
from django.utils import timezone
class Snapshot(models.Model):
data = models.JSONField()
project = models.ForeignKey('web.Project', on_delete=models.CASCADE)
created_at = models.DateTimeField(default=timezone.now)
class Meta:
indexes = [
models.Index(fields=['project', '-created_at'])
]