feat: add color, discount price, and new item attributes to catalog and update UI
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
All checks were successful
Build and Push Docker Image / build (push) Successful in 25s
- Introduced `Color` model with admin and added a color field to items - Added `discount_price` and `is_new` fields to the `Item` model with necessary migrations - Updated pricing logic to display original and discount prices in templates - Enhanced product detail and item card templates with color swatches and metadata - Added sidebar sections for sales and new items with paginated mini-cards - Updated styles to support discount pricing, swatches, and sidebar mini-cards - Extended catalog views to filter by sales or new items and updated filtering logic
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# Generated by Django 6.0.5 on 2026-05-25 15:20
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('items', '0003_subcategory_item_subcategory_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Color',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=100, verbose_name='Название цвета')),
|
||||
('hex_code', models.CharField(help_text='Например, #FF5500', max_length=7, verbose_name='Цвет (HEX)')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Цвет',
|
||||
'verbose_name_plural': 'Цвета',
|
||||
'ordering': ('name',),
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='discount_price',
|
||||
field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Цена со скидкой'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='is_new',
|
||||
field=models.BooleanField(default=False, verbose_name='Новинка'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='item',
|
||||
name='color',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='items', to='items.color', verbose_name='Цвет'),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user