Предварительная сохраняшка
This commit is contained in:
1 parent
ba33de3d77
commit
17f35a0f5d
875 files changed
+146196
-124
No files matched your search
@@ -0,0 +1,17 @@
|
||||
from django.db import models
|
||||
from accounts.models import User
|
||||
# Create your models here.
|
||||
class CountVisitor(models.Model):
|
||||
page = models.CharField(db_index=True, max_length=255)
|
||||
visitdate = models.DateField()
|
||||
user = models.ForeignKey(User, null=True, blank=True, on_delete=models.PROTECT)
|
||||
count = models.IntegerField(default=0)
|
||||
def __str__(self):
|
||||
return str(self.page)
|
||||
class Meta:
|
||||
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=['page', 'user', 'visitdate'], name='unique appversion')
|
||||
]
|
||||
|
||||
|
||||
Reference in new issue
Block a user