Added ability for stats to be tracked on products

This commit is contained in:
2024-01-30 21:49:17 +00:00
parent dfb33e195c
commit e27ed02028
4 changed files with 145 additions and 6 deletions

21
models/stats.py Normal file
View File

@ -0,0 +1,21 @@
from datetime import datetime
from models.users.user import User
from models.products.product import Product
class Stats:
def __init__(self):
""" Constructor for a Stat object """
self.id = 0
self.userID = 0
self.productID = 0
self.viewDate = datetime.now()
def __init__(self, product_id: int, user_id: int):
""" Construct a view with the user and product class """
self.id = 0
self.userID = user_id
self.productID = product_id
self.viewDate = datetime.now()