0001_initial.py 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. # Generated by Django 3.1.4 on 2020-12-01 07:12
  2. import django.contrib.auth.models
  3. import django.contrib.auth.validators
  4. import django.db.models.deletion
  5. import django.utils.timezone
  6. import imagekit.models.fields
  7. from django.conf import settings
  8. from django.db import migrations, models
  9. class Migration(migrations.Migration):
  10. initial = True
  11. dependencies = [
  12. ("auth", "0012_alter_user_first_name_max_length"),
  13. ]
  14. operations = [
  15. migrations.CreateModel(
  16. name="User",
  17. fields=[
  18. (
  19. "id",
  20. models.AutoField(
  21. auto_created=True,
  22. primary_key=True,
  23. serialize=False,
  24. verbose_name="ID",
  25. ),
  26. ),
  27. ("password", models.CharField(max_length=128, verbose_name="password")),
  28. (
  29. "last_login",
  30. models.DateTimeField(blank=True, null=True, verbose_name="last login"),
  31. ),
  32. (
  33. "is_superuser",
  34. models.BooleanField(
  35. default=False,
  36. help_text="Designates that this user has all permissions without explicitly assigning them.",
  37. verbose_name="superuser status",
  38. ),
  39. ),
  40. (
  41. "username",
  42. models.CharField(
  43. error_messages={"unique": "A user with that username already exists."},
  44. help_text="Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
  45. max_length=150,
  46. unique=True,
  47. validators=[django.contrib.auth.validators.UnicodeUsernameValidator()],
  48. verbose_name="username",
  49. ),
  50. ),
  51. (
  52. "first_name",
  53. models.CharField(blank=True, max_length=150, verbose_name="first name"),
  54. ),
  55. (
  56. "last_name",
  57. models.CharField(blank=True, max_length=150, verbose_name="last name"),
  58. ),
  59. (
  60. "email",
  61. models.EmailField(blank=True, max_length=254, verbose_name="email address"),
  62. ),
  63. (
  64. "is_staff",
  65. models.BooleanField(
  66. default=False,
  67. help_text="Designates whether the user can log into this admin site.",
  68. verbose_name="staff status",
  69. ),
  70. ),
  71. (
  72. "is_active",
  73. models.BooleanField(
  74. default=True,
  75. help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
  76. verbose_name="active",
  77. ),
  78. ),
  79. (
  80. "date_joined",
  81. models.DateTimeField(default=django.utils.timezone.now, verbose_name="date joined"),
  82. ),
  83. (
  84. "logo",
  85. imagekit.models.fields.ProcessedImageField(
  86. blank=True,
  87. default="userlogos/user.jpg",
  88. upload_to="userlogos/%Y/%m/%d",
  89. ),
  90. ),
  91. ("description", models.TextField(blank=True, verbose_name="About me")),
  92. (
  93. "name",
  94. models.CharField(db_index=True, max_length=250, verbose_name="full name"),
  95. ),
  96. (
  97. "date_added",
  98. models.DateTimeField(
  99. db_index=True,
  100. default=django.utils.timezone.now,
  101. verbose_name="date added",
  102. ),
  103. ),
  104. (
  105. "is_featured",
  106. models.BooleanField(db_index=True, default=False, verbose_name="Is featured"),
  107. ),
  108. (
  109. "title",
  110. models.CharField(blank=True, max_length=250, verbose_name="Title"),
  111. ),
  112. (
  113. "advancedUser",
  114. models.BooleanField(db_index=True, default=False, verbose_name="advanced user"),
  115. ),
  116. ("media_count", models.IntegerField(default=0)),
  117. (
  118. "notification_on_comments",
  119. models.BooleanField(
  120. default=True,
  121. verbose_name="Whether you will receive email notifications for comments added to your content",
  122. ),
  123. ),
  124. (
  125. "allow_contact",
  126. models.BooleanField(
  127. default=False,
  128. verbose_name="Whether allow contact will be shown on profile page",
  129. ),
  130. ),
  131. (
  132. "location",
  133. models.CharField(blank=True, max_length=250, verbose_name="Location"),
  134. ),
  135. (
  136. "is_editor",
  137. models.BooleanField(db_index=True, default=False, verbose_name="MediaCMS Editor"),
  138. ),
  139. (
  140. "is_manager",
  141. models.BooleanField(db_index=True, default=False, verbose_name="MediaCMS Manager"),
  142. ),
  143. (
  144. "groups",
  145. models.ManyToManyField(
  146. blank=True,
  147. help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
  148. related_name="user_set",
  149. related_query_name="user",
  150. to="auth.Group",
  151. verbose_name="groups",
  152. ),
  153. ),
  154. (
  155. "user_permissions",
  156. models.ManyToManyField(
  157. blank=True,
  158. help_text="Specific permissions for this user.",
  159. related_name="user_set",
  160. related_query_name="user",
  161. to="auth.Permission",
  162. verbose_name="user permissions",
  163. ),
  164. ),
  165. ],
  166. options={
  167. "ordering": ["-date_added", "name"],
  168. },
  169. managers=[
  170. ("objects", django.contrib.auth.models.UserManager()),
  171. ],
  172. ),
  173. migrations.CreateModel(
  174. name="Notification",
  175. fields=[
  176. (
  177. "id",
  178. models.AutoField(
  179. auto_created=True,
  180. primary_key=True,
  181. serialize=False,
  182. verbose_name="ID",
  183. ),
  184. ),
  185. ("action", models.CharField(blank=True, max_length=30)),
  186. ("notify", models.BooleanField(default=False)),
  187. (
  188. "method",
  189. models.CharField(choices=[("email", "Email")], default="email", max_length=20),
  190. ),
  191. (
  192. "user",
  193. models.ForeignKey(
  194. on_delete=django.db.models.deletion.CASCADE,
  195. related_name="notifications",
  196. to=settings.AUTH_USER_MODEL,
  197. ),
  198. ),
  199. ],
  200. ),
  201. migrations.CreateModel(
  202. name="Channel",
  203. fields=[
  204. (
  205. "id",
  206. models.AutoField(
  207. auto_created=True,
  208. primary_key=True,
  209. serialize=False,
  210. verbose_name="ID",
  211. ),
  212. ),
  213. ("title", models.CharField(db_index=True, max_length=90)),
  214. ("description", models.TextField(blank=True, help_text="description")),
  215. ("add_date", models.DateTimeField(auto_now_add=True, db_index=True)),
  216. ("friendly_token", models.CharField(blank=True, max_length=12)),
  217. (
  218. "banner_logo",
  219. imagekit.models.fields.ProcessedImageField(
  220. blank=True,
  221. default="userlogos/banner.jpg",
  222. upload_to="userlogos/%Y/%m/%d",
  223. ),
  224. ),
  225. (
  226. "subscribers",
  227. models.ManyToManyField(
  228. blank=True,
  229. related_name="subscriptions",
  230. to=settings.AUTH_USER_MODEL,
  231. ),
  232. ),
  233. (
  234. "user",
  235. models.ForeignKey(
  236. on_delete=django.db.models.deletion.CASCADE,
  237. related_name="channels",
  238. to=settings.AUTH_USER_MODEL,
  239. ),
  240. ),
  241. ],
  242. ),
  243. migrations.AddIndex(
  244. model_name="user",
  245. index=models.Index(fields=["-date_added", "name"], name="users_user_date_ad_4eb0b8_idx"),
  246. ),
  247. ]