1
class Produtos(models.Model):
#id = models.AutoField(primary_key=True)
nomeproduto = models.CharField(max_length=50, blank=True, null=True)
quantproduto = models.CharField(max_length=30, blank=False, unique=True)
status = models.CharField('Status', max_length=10, default='ATIVO', blank=False, null=False)
class Meta:
db_table: str = 'usuarios'
ordering = ('nome_produto',)
The main problem is he report identation error but I’m blind I’m beginner in language so any obvious mistake please speak to me.
Please note that in the option Ordering of the Meta class you use 'product name', This is different from the compo product name that you defined in the Product class, that way you are not referencing the field, because product name is different from product name.
– Heidy Miguel