51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
|
# Generated by Django 3.1 on 2020-08-14 13:16
|
||
|
|
||
|
import django.db.models.deletion
|
||
|
from django.conf import settings
|
||
|
from django.db import migrations, models
|
||
|
|
||
|
|
||
|
class Migration(migrations.Migration):
|
||
|
|
||
|
dependencies = [
|
||
|
("articles", "0001_initial"),
|
||
|
]
|
||
|
|
||
|
operations = [
|
||
|
migrations.CreateModel(
|
||
|
name="Article",
|
||
|
fields=[
|
||
|
(
|
||
|
"id",
|
||
|
models.AutoField(
|
||
|
auto_created=True,
|
||
|
primary_key=True,
|
||
|
serialize=False,
|
||
|
verbose_name="ID",
|
||
|
),
|
||
|
),
|
||
|
("title", models.CharField(max_length=255)),
|
||
|
("content", models.TextField()),
|
||
|
(
|
||
|
"status",
|
||
|
models.CharField(
|
||
|
choices=[("draft", "Draft"), ("published", "Published")],
|
||
|
default="draft",
|
||
|
max_length=15,
|
||
|
),
|
||
|
),
|
||
|
("published_at", models.DateTimeField(null=True)),
|
||
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
||
|
("updated_at", models.DateTimeField(auto_now=True)),
|
||
|
(
|
||
|
"author",
|
||
|
models.ForeignKey(
|
||
|
on_delete=django.db.models.deletion.PROTECT,
|
||
|
to=settings.AUTH_USER_MODEL,
|
||
|
),
|
||
|
),
|
||
|
],
|
||
|
options={"ordering": ["-published_at"],},
|
||
|
),
|
||
|
]
|