new update
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.core.validators import MinValueValidator, MaxValueValidator
|
||||
|
||||
|
||||
|
||||
class Client(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
@@ -9,12 +13,39 @@ class Client(models.Model):
|
||||
|
||||
class ExcelEntry(models.Model):
|
||||
client = models.ForeignKey(Client, on_delete=models.CASCADE)
|
||||
age = models.IntegerField()
|
||||
email = models.EmailField()
|
||||
date = models.DateField(default=timezone.now)
|
||||
pressure = models.DecimalField(
|
||||
max_digits=10,
|
||||
decimal_places=2,
|
||||
validators=[MinValueValidator(0)],
|
||||
default=0.00
|
||||
)
|
||||
purity = models.DecimalField(
|
||||
max_digits=5,
|
||||
decimal_places=2,
|
||||
validators=[MinValueValidator(0), MaxValueValidator(100)],
|
||||
default=0.00
|
||||
)
|
||||
notes = models.TextField(blank=True, null=True)
|
||||
date_joined = models.DateField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.client.name} - {self.date}"
|
||||
|
||||
class SecondTableEntry(models.Model):
|
||||
client = models.ForeignKey(Client, on_delete=models.CASCADE)
|
||||
age = models.IntegerField()
|
||||
email = models.EmailField()
|
||||
date = models.DateField(default=timezone.now) # Added default value
|
||||
is_warm = models.BooleanField(default=False)
|
||||
lhe_delivery = models.CharField(max_length=100, blank=True, null=True)
|
||||
lhe_output = models.DecimalField(
|
||||
max_digits=10,
|
||||
decimal_places=2,
|
||||
validators=[MinValueValidator(0)],
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
notes = models.TextField(blank=True, null=True)
|
||||
date_joined = models.DateField(auto_now_add=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.client.name} - {self.date}"
|
Reference in New Issue
Block a user