This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> desc categorias_categoria; | |
+-------+--------------+------+-----+---------+----------------+ | |
| Field | Type | Null | Key | Default | Extra | | |
+-------+--------------+------+-----+---------+----------------+ | |
| id | int(11) | NO | PRI | NULL | auto_increment | | |
| nome | varchar(128) | NO | | NULL | | | |
+-------+--------------+------+-----+---------+----------------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#produtos/models.py | |
class Produto(models.Model): | |
nome = models.CharField( | |
'Nome', | |
max_length=128 | |
) | |
valor = models.DecimalField( | |
'Valor', | |
max_digits=10, | |
decimal_places=2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#categorias/model.py | |
class Categoria(models.Model): | |
nome = models.CharField('Nome', max_length=128) |
NewerOlder