66 lines
2.2 KiB
Python
66 lines
2.2 KiB
Python
# Generated by Django 3.2.4 on 2021-06-15 08:34
|
|
|
|
import django.db.models.deletion
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Faq",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.AutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title_fr", models.CharField(max_length=255, verbose_name="titre")),
|
|
(
|
|
"title_en",
|
|
models.CharField(blank=True, max_length=255, verbose_name="titre"),
|
|
),
|
|
("description_fr", models.TextField(verbose_name="description")),
|
|
(
|
|
"description_en",
|
|
models.TextField(blank=True, verbose_name="description"),
|
|
),
|
|
("content_fr", models.TextField(blank=True, verbose_name="contenu")),
|
|
("content_en", models.TextField(blank=True, verbose_name="contenu")),
|
|
(
|
|
"last_modified",
|
|
models.DateField(auto_now=True, verbose_name="mise à jour"),
|
|
),
|
|
("anchor", models.CharField(max_length=20, verbose_name="ancre")),
|
|
(
|
|
"author",
|
|
models.ForeignKey(
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="faqs",
|
|
to=settings.AUTH_USER_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"permissions": [("is_author", "Can create faqs")],
|
|
},
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name="faq",
|
|
constraint=models.UniqueConstraint(
|
|
fields=("anchor",), name="unique_faq_anchor"
|
|
),
|
|
),
|
|
]
|