Files
lab-django/autoapp/migrations/0001_initial.py
2026-02-22 12:29:18 +05:00

78 lines
2.5 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Generated by Django 5.2.11 on 2026-02-22 06:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Auto",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"brand",
models.CharField(
help_text="Например: Toyota, BMW, Lada",
max_length=100,
verbose_name="Марка",
),
),
(
"model",
models.CharField(
help_text="Например: Camry, X5, Granta",
max_length=100,
verbose_name="Модель",
),
),
(
"year",
models.PositiveIntegerField(
help_text="Год выпуска автомобиля (например, 2023)",
verbose_name="Год выпуска",
),
),
(
"color",
models.CharField(
blank=True,
default="Не указан",
help_text="Например: чёрный, серебристый, красный",
max_length=50,
verbose_name="Цвет",
),
),
(
"created_at",
models.DateTimeField(
auto_now_add=True, verbose_name="Дата создания записи"
),
),
(
"updated_at",
models.DateTimeField(
auto_now=True, verbose_name="Дата последнего изменения"
),
),
],
options={
"verbose_name": "Автомобиль",
"verbose_name_plural": "Автомобили",
"ordering": ["-year", "brand", "model"],
},
),
]