Debian Codegraph @

examples/regular-django/example/users/migrations/0001_initial.py

raw
1 import uuid
2
3 import django.contrib.auth.models
4 import django.contrib.auth.validators
5 import django.utils.timezone
6 from django.db import migrations, models
7
8
9 class Migration(migrations.Migration):
10
11 initial = True
12
13 dependencies = [
14 ("auth", "0012_alter_user_first_name_max_length"),
15 ]
16
17 operations = [
18 migrations.CreateModel(
19 name="User",
20 fields=[
21 ("password", models.CharField(max_length=128, verbose_name="password")),
22 (
23 "last_login",
24 models.DateTimeField(
25 blank=True, null=True, verbose_name="last login"
26 ),
27 ),
28 (
29 "is_superuser",
30 models.BooleanField(
31 default=False,
32 help_text="Designates that this user has all permissions without explicitly assigning them.",
33 verbose_name="superuser status",
34 ),
35 ),
36 (
37 "username",
38 models.CharField(
39 error_messages={
40 "unique": "A user with that username already exists."
41 },
42 help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
43 max_length=150,
44 unique=True,
45 validators=[
46 django.contrib.auth.validators.UnicodeUsernameValidator()
47 ],
48 verbose_name="username",
49 ),
50 ),
51 (
52 "first_name",
53 models.CharField(
54 blank=True, max_length=150, verbose_name="first name"
55 ),
56 ),
57 (
58 "last_name",
59 models.CharField(
60 blank=True, max_length=150, verbose_name="last name"
61 ),
62 ),
63 (
64 "email",
65 models.EmailField(
66 blank=True, max_length=254, verbose_name="email address"
67 ),
68 ),
69 (
70 "is_staff",
71 models.BooleanField(
72 default=False,
73 help_text="Designates whether the user can log into this admin site.",
74 verbose_name="staff status",
75 ),
76 ),
77 (
78 "is_active",
79 models.BooleanField(
80 default=True,
81 help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
82 verbose_name="active",
83 ),
84 ),
85 (
86 "date_joined",
87 models.DateTimeField(
88 default=django.utils.timezone.now, verbose_name="date joined"
89 ),
90 ),
91 (
92 "id",
93 models.UUIDField(
94 default=uuid.uuid4, primary_key=True, serialize=False
95 ),
96 ),
97 (
98 "phone",
99 models.CharField(blank=True, max_length=16, null=True, unique=True),
100 ),
101 ("phone_verified", models.BooleanField(default=False)),
102 (
103 "groups",
104 models.ManyToManyField(
105 blank=True,
106 help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
107 related_name="user_set",
108 related_query_name="user",
109 to="auth.group",
110 verbose_name="groups",
111 ),
112 ),
113 (
114 "user_permissions",
115 models.ManyToManyField(
116 blank=True,
117 help_text="Specific permissions for this user.",
118 related_name="user_set",
119 related_query_name="user",
120 to="auth.permission",
121 verbose_name="user permissions",
122 ),
123 ),
124 ],
125 options={
126 "verbose_name": "user",
127 "verbose_name_plural": "users",
128 "abstract": False,
129 },
130 managers=[
131 ("objects", django.contrib.auth.models.UserManager()),
132 ],
133 ),
134 ]