d0dfa3eaa7
- Created ShopModel with fields for shop name, description, and user association. - Updated ProductModel to include a foreign key relationship with ShopModel. - Added admin interface for ShopModel with search functionality. - Created migrations for ShopModel and its integration with ProductModel.
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
# Generated by Django 5.1.2 on 2025-08-02 15:21
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('account', '0028_newsmodel_is_read'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ShopModel',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('shop_name', models.CharField(max_length=100, verbose_name='نام فروشگاه')),
|
|
('shop_description', models.TextField(verbose_name='توضیحات فروشگاه')),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='shop', to=settings.AUTH_USER_MODEL, verbose_name='کاربر')),
|
|
],
|
|
options={
|
|
'verbose_name': 'فروشگاه',
|
|
'verbose_name_plural': 'فروشگاه ها',
|
|
},
|
|
),
|
|
]
|