change: add new model and fix migrations
This commit is contained in:
@@ -72,4 +72,9 @@ class ContactUsAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(models.News)
|
||||
class NewsAdmin(TranslationAdmin):
|
||||
list_display = ['title', 'text', 'image']
|
||||
list_display = ['title', 'text', 'image']
|
||||
|
||||
|
||||
@admin.register(models.Country)
|
||||
class CountryAdmin(admin.ModelAdmin):
|
||||
list_display = ['name']
|
||||
@@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.2 on 2025-08-26 12:25
|
||||
# Generated by Django 5.2 on 2025-08-27 15:49
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
@@ -46,6 +46,19 @@ class Migration(migrations.Migration):
|
||||
'verbose_name_plural': 'bannerlar',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Country',
|
||||
fields=[
|
||||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
||||
('created_at', models.DateField(auto_now_add=True)),
|
||||
('updated_at', models.DateField(auto_now=True)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Davlat',
|
||||
'verbose_name_plural': 'Davlatlar',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='News',
|
||||
fields=[
|
||||
@@ -85,11 +98,12 @@ class Migration(migrations.Migration):
|
||||
('image', models.ImageField(upload_to='service/images/')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
'verbose_name': 'Xizmatlar',
|
||||
'verbose_name_plural': 'Xizmatlarimiz',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SiteConfir',
|
||||
name='SiteConfig',
|
||||
fields=[
|
||||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
||||
('created_at', models.DateField(auto_now_add=True)),
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-26 12:26
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('common', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameModel(
|
||||
old_name='SiteConfir',
|
||||
new_name='SiteConfig',
|
||||
),
|
||||
]
|
||||
@@ -1,17 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-26 14:00
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('common', '0002_rename_siteconfir_siteconfig'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='service',
|
||||
options={'verbose_name': 'Xizmatlar', 'verbose_name_plural': 'Xizmatlarimiz'},
|
||||
),
|
||||
]
|
||||
@@ -1,27 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-27 15:43
|
||||
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('common', '0003_alter_service_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Country',
|
||||
fields=[
|
||||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
||||
('created_at', models.DateField(auto_now_add=True)),
|
||||
('updated_at', models.DateField(auto_now=True)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Davlat',
|
||||
'verbose_name_plural': 'Davlatlar',
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -1,4 +1,4 @@
|
||||
# Generated by Django 5.2 on 2025-08-26 14:00
|
||||
# Generated by Django 5.2 on 2025-08-27 15:49
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
@@ -11,6 +11,7 @@ class Migration(migrations.Migration):
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('common', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
@@ -21,13 +22,22 @@ class Migration(migrations.Migration):
|
||||
('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
|
||||
('created_at', models.DateField(auto_now_add=True)),
|
||||
('updated_at', models.DateField(auto_now=True)),
|
||||
('order_number', models.PositiveBigIntegerField(default=1)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('name_uz', models.CharField(max_length=200, null=True)),
|
||||
('name_en', models.CharField(max_length=200, null=True)),
|
||||
('name_ru', models.CharField(max_length=200, null=True)),
|
||||
('date', models.DateField()),
|
||||
('status', models.CharField(choices=[('Yetkazilmoqda', 'Yetkazilmoqda'), ('Olingan', 'Olingan'), ('Kutilmoqda', 'Kutilmoqda'), ('Yetkazib berilgan', 'Yetkazib berilgan')], max_length=20)),
|
||||
('size', models.CharField(max_length=20)),
|
||||
('total_price', models.PositiveBigIntegerField()),
|
||||
('is_paid', models.BooleanField(default=False)),
|
||||
('location', models.CharField(max_length=200)),
|
||||
('location_uz', models.CharField(max_length=200, null=True)),
|
||||
('location_en', models.CharField(max_length=200, null=True)),
|
||||
('location_ru', models.CharField(max_length=200, null=True)),
|
||||
('location_from', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_from', to='common.country')),
|
||||
('location_to', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_to', to='common.country')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-26 14:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('orders', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_en',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_ru',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_uz',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='name_en',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='name_ru',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='name_uz',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
]
|
||||
@@ -1,18 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-27 14:19
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('orders', '0002_order_location_en_order_location_ru_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='order_number',
|
||||
field=models.PositiveBigIntegerField(default=1),
|
||||
),
|
||||
]
|
||||
@@ -1,55 +0,0 @@
|
||||
# Generated by Django 5.2 on 2025-08-27 15:43
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('common', '0004_country'),
|
||||
('orders', '0003_order_order_number'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_from',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_from', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_from_en',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_from', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_from_ru',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_from', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_from_uz',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_from', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_to',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_to', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_to_en',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_to', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_to_ru',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_to', to='common.country'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='location_to_uz',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='location_to', to='common.country'),
|
||||
),
|
||||
]
|
||||
@@ -6,5 +6,5 @@ from core.apps.orders.models import Order
|
||||
@translator.register(Order)
|
||||
class OrderTranslation(translator.TranslationOptions):
|
||||
fields = [
|
||||
'name', 'location', 'location_to', 'location_from'
|
||||
'name', 'location'
|
||||
]
|
||||
Reference in New Issue
Block a user