from django.db import models class AttributeMaster(models.Model): name = models.CharField(max_length=100, unique=True) # e.g., "Brand", "Capacity" is_mandatory = models.BooleanField(default=False) def __str__(self): return self.name class TitleMapping(models.Model): product_type = models.CharField(max_length=255, unique=True) # e.g., "Flammable Safety Cabinet-Links" # Store sequence as a comma-separated string: "Brand,Product Type,Door Type,Capacity,Dimensions,Color" format_sequence = models.TextField() def get_sequence_list(self): return [item.strip() for item in self.format_sequence.split(',') if item.strip()] def __str__(self): return self.product_type class ProcessingTask(models.Model): task_id = models.CharField(max_length=100, unique=True) original_filename = models.CharField(max_length=255, null=True, blank=True) # New field status = models.CharField(max_length=20, default='PENDING') download_url = models.TextField(null=True, blank=True) created_at = models.DateTimeField(auto_now_add=True) def __str__(self): return f"{self.original_filename} - {self.status}"