58 lines
2.2 KiB
Python
58 lines
2.2 KiB
Python
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Region",
|
|
fields=[
|
|
("code", models.CharField(max_length=8, primary_key=True, serialize=False)),
|
|
("name", models.CharField(max_length=120)),
|
|
(
|
|
"level",
|
|
models.CharField(
|
|
choices=[("country", "Country"), ("subdivision", "Subdivision")],
|
|
max_length=16,
|
|
),
|
|
),
|
|
(
|
|
"parent",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="subdivisions",
|
|
to="showcase.region",
|
|
),
|
|
),
|
|
],
|
|
options={"ordering": ("name",)},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PortfolioEntry",
|
|
fields=[
|
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
|
("entry_type", models.CharField(choices=[("work", "Work"), ("cv", "CV")], max_length=8)),
|
|
("title", models.CharField(max_length=160)),
|
|
("organization", models.CharField(blank=True, max_length=160)),
|
|
("start_date", models.DateField(blank=True, null=True)),
|
|
("end_date", models.DateField(blank=True, null=True)),
|
|
("summary", models.TextField()),
|
|
("url", models.URLField(blank=True)),
|
|
("is_published", models.BooleanField(default=False)),
|
|
("display_order", models.PositiveIntegerField(default=0)),
|
|
("regions", models.ManyToManyField(related_name="entries", to="showcase.region")),
|
|
],
|
|
options={
|
|
"verbose_name_plural": "portfolio entries",
|
|
"ordering": ("display_order", "-start_date", "title"),
|
|
},
|
|
),
|
|
]
|
|
|