from django.db import models from django.utils.timezone import now class ProcessStartHistory(models.Model): state = models.CharField(max_length=100, null=False, blank=False) # State name zip_code = models.CharField(max_length=20, null=False, blank=False) # Zip code started_at = models.DateTimeField(default=now) # When the process started stopped_at = models.DateTimeField(null=True, blank=True) # When the process stopped concrete_count = models.IntegerField(default=0, null=True, blank=True) # Concrete count asphalt_count = models.IntegerField(default=0, null=True, blank=True) # Asphalt count class Meta: db_table = 'process_start_history' # Table name in the database verbose_name = 'Process Start History' verbose_name_plural = 'Process Start Histories' def __str__(self): return f"ProcessStartHistory(state={self.state}, zip_code={self.zip_code}, started_at={self.started_at})" class SealkingDataMN(models.Model): id = models.AutoField(primary_key=True) # Auto-incremented primary key zip_code = models.IntegerField(null=True, blank=True) # Corresponds to `Zip_Code` full_address = models.CharField(max_length=255, null=True, blank=True) # Corresponds to `fulladdress` status = models.CharField(max_length=255, null=True, blank=True) # Corresponds to `status` notes = models.CharField(max_length=255, null=True, blank=True) # Corresponds to `notes` confidence = models.CharField(max_length=255, null=True, blank=True) # Corresponds to `confidence` google_image_url = models.CharField(max_length=255, null=True, blank=True) # Corresponds to `google_image_url` class Meta: db_table = 'sealking_data_MN' # Match the table name in the database verbose_name = 'Sealking Data' verbose_name_plural = 'Sealking Data' def __str__(self): return f"SealkingDataMNNew(id={self.id}, zip_code={self.zip_code})" class SealkingDataWI(models.Model): id = models.AutoField(primary_key=True) full_address = models.CharField(max_length=255, null=True, blank=True) zip_code = models.IntegerField(null=True, blank=True) status = models.CharField(max_length=255, null=True, blank=True) confidence = models.CharField(max_length=255, null=True, blank=True) google_image_url =models.CharField(max_length=255, null=True, blank=True) notes = models.CharField(max_length=255, null=True, blank=True) class Meta: db_table = 'sealking_data_WI' def __str__(self): return f"{self.full_address} - {self.zip_code}"