image field
This commit is contained in:
parent
96a9dc1114
commit
96f1933ab4
18
alkatorapi/migrations/0020_alter_product_img.py
Normal file
18
alkatorapi/migrations/0020_alter_product_img.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 4.2.12 on 2024-10-13 07:22
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('alkatorapi', '0019_cart_invoice_product_remove_racer_id_and_more'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='product',
|
||||||
|
name='img',
|
||||||
|
field=models.ImageField(upload_to='photos'),
|
||||||
|
),
|
||||||
|
]
|
@ -67,7 +67,7 @@ class Profile(models.Model):
|
|||||||
class Product(models.Model):
|
class Product(models.Model):
|
||||||
name = models.CharField(max_length=120)
|
name = models.CharField(max_length=120)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
img = models.CharField(max_length=120)
|
img = models.ImageField(upload_to="photos")
|
||||||
price = models.IntegerField()
|
price = models.IntegerField()
|
||||||
quantity = models.IntegerField()
|
quantity = models.IntegerField()
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ def products(request):
|
|||||||
{
|
{
|
||||||
'name': product.name,
|
'name': product.name,
|
||||||
'description': product.description,
|
'description': product.description,
|
||||||
'img': product.img,
|
'img': product.img.path,
|
||||||
'price': product.price,
|
'price': product.price,
|
||||||
'quantity': product.quantity,
|
'quantity': product.quantity,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user