0001_initial.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Generated by Django 5.1.1 on 2024-09-30 11:37
  2. import account.managers
  3. import django.utils.timezone
  4. from django.db import migrations, models
  5. class Migration(migrations.Migration):
  6. initial = True
  7. dependencies = [
  8. ("auth", "0012_alter_user_first_name_max_length"),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name="User",
  13. fields=[
  14. (
  15. "id",
  16. models.BigAutoField(
  17. auto_created=True,
  18. primary_key=True,
  19. serialize=False,
  20. verbose_name="ID",
  21. ),
  22. ),
  23. ("password", models.CharField(max_length=128, verbose_name="password")),
  24. (
  25. "last_login",
  26. models.DateTimeField(
  27. blank=True, null=True, verbose_name="last login"
  28. ),
  29. ),
  30. (
  31. "is_superuser",
  32. models.BooleanField(
  33. default=False,
  34. help_text="Designates that this user has all permissions without explicitly assigning them.",
  35. verbose_name="superuser status",
  36. ),
  37. ),
  38. (
  39. "first_name",
  40. models.CharField(
  41. blank=True, max_length=150, verbose_name="first name"
  42. ),
  43. ),
  44. (
  45. "last_name",
  46. models.CharField(
  47. blank=True, max_length=150, verbose_name="last name"
  48. ),
  49. ),
  50. (
  51. "email",
  52. models.EmailField(
  53. max_length=254, unique=True, verbose_name="email address"
  54. ),
  55. ),
  56. (
  57. "is_staff",
  58. models.BooleanField(
  59. default=False,
  60. help_text="Designates whether the user can log into this admin site.",
  61. verbose_name="staff status",
  62. ),
  63. ),
  64. (
  65. "is_active",
  66. models.BooleanField(
  67. default=True,
  68. help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
  69. verbose_name="active",
  70. ),
  71. ),
  72. (
  73. "date_joined",
  74. models.DateTimeField(
  75. default=django.utils.timezone.now, verbose_name="date joined"
  76. ),
  77. ),
  78. (
  79. "groups",
  80. models.ManyToManyField(
  81. blank=True,
  82. help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
  83. related_name="user_set",
  84. related_query_name="user",
  85. to="auth.group",
  86. verbose_name="groups",
  87. ),
  88. ),
  89. (
  90. "user_permissions",
  91. models.ManyToManyField(
  92. blank=True,
  93. help_text="Specific permissions for this user.",
  94. related_name="user_set",
  95. related_query_name="user",
  96. to="auth.permission",
  97. verbose_name="user permissions",
  98. ),
  99. ),
  100. ],
  101. options={
  102. "verbose_name": "user",
  103. "verbose_name_plural": "users",
  104. },
  105. managers=[
  106. ("objects", account.managers.UserManager()),
  107. ],
  108. ),
  109. ]