baza danych nowe pola

This commit is contained in:
Jędrzej Klepacki 2020-12-10 20:58:53 +01:00
parent 956bef5b19
commit 2dca3cd033
2 changed files with 6 additions and 0 deletions

View File

@ -6,11 +6,17 @@ TYPE_T = (
(2,'Oddam'), (2,'Oddam'),
) )
TYPE_O = (
(1,'Usługa'),
(2,'Przedmiot'),
)
class Product(models.Model): class Product(models.Model):
active = models.BooleanField(default=True)
picture = models.ImageField(null=True, blank=True, upload_to="images/") picture = models.ImageField(null=True, blank=True, upload_to="images/")
create_date = models.DateField(("Date"), default=datetime.date.today) create_date = models.DateField(("Date"), default=datetime.date.today)
user_owner = models.TextField(max_length=40, blank=False, default="") user_owner = models.TextField(max_length=40, blank=False, default="")
type = models.IntegerField(choices = TYPE_T, blank=False, default="") type = models.IntegerField(choices = TYPE_T, blank=False, default="")
offer = models.IntegerField(choices = TYPE_O, blank=False, default="")
title = models.TextField(max_length=40, blank=False, default="") title = models.TextField(max_length=40, blank=False, default="")
description = models.TextField(max_length=6000, blank=False, default="") description = models.TextField(max_length=6000, blank=False, default="")
place = models.TextField(max_length=40, blank=False, default="") place = models.TextField(max_length=40, blank=False, default="")