Sith/core/migrations/0012_notification.py

60 lines
1.9 KiB
Python
Raw Normal View History

2016-12-08 18:47:28 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.utils.timezone
import django.db.models.deletion
2016-12-08 18:47:28 +00:00
class Migration(migrations.Migration):
2018-10-04 19:29:19 +00:00
dependencies = [("core", "0011_auto_20161124_0848")]
2016-12-08 18:47:28 +00:00
operations = [
migrations.CreateModel(
2018-10-04 19:29:19 +00:00
name="Notification",
2016-12-08 18:47:28 +00:00
fields=[
2018-10-04 19:29:19 +00:00
(
"id",
models.AutoField(
primary_key=True,
verbose_name="ID",
auto_created=True,
serialize=False,
),
),
("url", models.CharField(max_length=255, verbose_name="url")),
("text", models.CharField(max_length=512, verbose_name="text")),
(
"type",
models.CharField(
max_length=16,
choices=[
("FILE_MODERATION", "File moderation"),
("SAS_MODERATION", "SAS moderation"),
("NEW_PICTURES", "New pictures"),
],
verbose_name="text",
null=True,
blank=True,
),
),
(
"date",
models.DateTimeField(
verbose_name="date", default=django.utils.timezone.now
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="notifications",
to=settings.AUTH_USER_MODEL,
2018-10-04 19:29:19 +00:00
),
),
2016-12-08 18:47:28 +00:00
],
2018-10-04 19:29:19 +00:00
)
2016-12-08 18:47:28 +00:00
]