feat: add new custom heritage fields to Product model
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 31s

This commit is contained in:
vickytechkey 2026-08-18 12:22:55 +05:30
parent ff6f776b85
commit 05e313b837
2 changed files with 75 additions and 0 deletions

View file

@ -0,0 +1,63 @@
# Generated by Django 6.1 on 2026-08-18 06:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_category_supplierprofile_business_type_and_more'),
]
operations = [
migrations.AddField(
model_name='product',
name='additional_images',
field=models.JSONField(blank=True, default=list, null=True),
),
migrations.AddField(
model_name='product',
name='compare_at_price',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True),
),
migrations.AddField(
model_name='product',
name='description',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='product',
name='is_gi_tagged',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='product',
name='package_weight',
field=models.FloatField(default=1.0),
),
migrations.AddField(
model_name='product',
name='processing_days',
field=models.IntegerField(default=3),
),
migrations.AddField(
model_name='product',
name='shipping_profile',
field=models.CharField(default='Standard Fragile', max_length=100),
),
migrations.AddField(
model_name='product',
name='track_inventory',
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name='product',
name='video_url',
field=models.URLField(blank=True, null=True),
),
migrations.AddField(
model_name='product',
name='view_360_url',
field=models.URLField(blank=True, null=True),
),
]

View file

@ -111,6 +111,18 @@ class Product(models.Model):
image = models.TextField(blank=True, null=True) # Can store URL or base64 image = models.TextField(blank=True, null=True) # Can store URL or base64
status = models.CharField(max_length=50, default='pending') status = models.CharField(max_length=50, default='pending')
is_active = models.BooleanField(default=True) is_active = models.BooleanField(default=True)
# New heritage fields from UI designs
description = models.TextField(blank=True, null=True)
is_gi_tagged = models.BooleanField(default=False)
additional_images = models.JSONField(default=list, blank=True, null=True)
video_url = models.URLField(blank=True, null=True)
view_360_url = models.URLField(blank=True, null=True)
compare_at_price = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
track_inventory = models.BooleanField(default=True)
shipping_profile = models.CharField(max_length=100, default='Standard Fragile')
processing_days = models.IntegerField(default=3)
package_weight = models.FloatField(default=1.0)
def __str__(self): def __str__(self):
return self.title return self.title