Files
PORTAL_COD2/src/watcher/models.py
T
2023-11-02 12:14:25 +03:00

25 lines
659 B
Python

from django.db import models
from accounts.models import User
# Create your models here.
import pandas as pd
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)
fullPath = models.CharField(max_length=255)
def __str__(self):
return str(self.page)
class Meta:
constraints = [
models.UniqueConstraint(fields=['page', 'user', 'visitdate', 'fullPath'], name='unique appversion')
]