79592990

Date: 2025-04-25 16:58:19
Score: 1.5
Natty:
Report link

Is there a specific need to use the "product" Model? Maybe an abstract Model would do the trick in your case?

class products(models.Model):  # COMM0N 
    product_name = models.CharField(max_length=100) 
    product_id = models.PositiveSmallIntegerField()
    product_desc = models.CharField(max_length=512) 

    [. other śhared fields and functions]
  
    class Meta: 
        abstract = True`


class shirt(product):
    class Size(models.IntegerChoices):
        S = 1, "SMALL"
        M = 2, "MEDIUM"
        L = 3, "LARGE"
        # (...)

    size = models.PositiveSmallIntegerField(
        choices=Size.choices,
        default=Size.S

    product_tyoe = "shirt"
    )
Reasons:
  • Whitelisted phrase (-1): in your case
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Is there a
  • Low reputation (1):
Posted by: Vorletzter