-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy path0001_initial.py
118 lines (113 loc) · 4.21 KB
/
0001_initial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Generated by Django 4.2.1 on 2023-05-28 11:38
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("sites", "0002_alter_domain_unique"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="CustomComment",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"object_pk",
models.CharField(
db_index=True, max_length=64, verbose_name="object ID"
),
),
(
"user_name",
models.CharField(
blank=True, max_length=50, verbose_name="user's name"
),
),
(
"user_email",
models.EmailField(
blank=True, max_length=254, verbose_name="user's email address"
),
),
("user_url", models.URLField(blank=True, verbose_name="user's URL")),
("comment", models.TextField(max_length=3000, verbose_name="comment")),
(
"submit_date",
models.DateTimeField(
db_index=True, default=None, verbose_name="date/time submitted"
),
),
(
"ip_address",
models.GenericIPAddressField(
blank=True,
null=True,
unpack_ipv4=True,
verbose_name="IP address",
),
),
(
"is_public",
models.BooleanField(
default=True,
help_text="Uncheck this box to make the comment effectively disappear from the site.",
verbose_name="is public",
),
),
(
"is_removed",
models.BooleanField(
db_index=True,
default=False,
help_text='Check this box if the comment is inappropriate. A "This comment has been removed" message will be displayed instead.',
verbose_name="is removed",
),
),
("file", models.FileField(upload_to="")),
(
"content_type",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="content_type_set_for_%(class)s",
to="contenttypes.contenttype",
verbose_name="content type",
),
),
(
"site",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="sites.site"
),
),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="%(class)s_comments",
to=settings.AUTH_USER_MODEL,
verbose_name="user",
),
),
],
options={
"verbose_name": "comment",
"verbose_name_plural": "comments",
"ordering": ("submit_date",),
"permissions": [("can_moderate", "Can moderate comments")],
"abstract": False,
},
),
]