mirror of
https://github.com/Rushilwiz/pushup-contest.git
synced 2025-04-09 21:20:15 -04:00
14 lines
363 B
Python
14 lines
363 B
Python
from django.db import models
|
|
from django.utils import timezone
|
|
|
|
# Create your models here.
|
|
|
|
def get_time():
|
|
return timezone.localtime(timezone.now())
|
|
|
|
class StockValue(models.Model):
|
|
value = models.DecimalField(max_digits=5, decimal_places=3)
|
|
time = models.DateTimeField(default=get_time)
|
|
|
|
def __str__(self):
|
|
return f"Price at {self.time}" |