mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
first commit
This commit is contained in:
15
gestaoRaul/products/models.py
Normal file
15
gestaoRaul/products/models.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from django.db import models
|
||||
|
||||
from categories.models import Categories
|
||||
|
||||
# Create your models here.
|
||||
class Product(models.Model):
|
||||
id = models.AutoField(primary_key=True)
|
||||
name = models.CharField(max_length=100)
|
||||
description = models.TextField(null=True, blank=True)
|
||||
price = models.DecimalField(max_digits=10, decimal_places=2)
|
||||
category = models.ForeignKey(Categories, on_delete=models.CASCADE)
|
||||
active = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.name
|
||||
Reference in New Issue
Block a user