0001_initial.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import models, migrations
  4. from django.conf import settings
  5. class Migration(migrations.Migration):
  6. dependencies = [
  7. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  8. ]
  9. operations = [
  10. migrations.CreateModel(
  11. name='Comment',
  12. fields=[
  13. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  14. ('comment_text', models.CharField(default=b'none', max_length=160)),
  15. ('comment_datetime', models.DateTimeField(auto_now_add=True)),
  16. ],
  17. options={
  18. },
  19. bases=(models.Model,),
  20. ),
  21. migrations.CreateModel(
  22. name='Posts',
  23. fields=[
  24. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  25. ('post_content', models.CharField(default=b'none', max_length=160)),
  26. ('date_time', models.DateTimeField(auto_now_add=True)),
  27. ('user', models.ForeignKey(default=b'none', to=settings.AUTH_USER_MODEL)),
  28. ],
  29. options={
  30. },
  31. bases=(models.Model,),
  32. ),
  33. migrations.CreateModel(
  34. name='Profile',
  35. fields=[
  36. ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
  37. ('age', models.IntegerField(max_length=3, null=True, blank=True)),
  38. ('bio', models.CharField(max_length=430, blank=True)),
  39. ('picture_url', models.CharField(max_length=256, blank=True)),
  40. ('followusers', models.ManyToManyField(related_name='follow+', to=settings.AUTH_USER_MODEL)),
  41. ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
  42. ],
  43. options={
  44. },
  45. bases=(models.Model,),
  46. ),
  47. migrations.AddField(
  48. model_name='comment',
  49. name='comment_by',
  50. field=models.ForeignKey(to='socialnetwork.Profile'),
  51. preserve_default=True,
  52. ),
  53. migrations.AddField(
  54. model_name='comment',
  55. name='comment_post',
  56. field=models.ForeignKey(to='socialnetwork.Posts'),
  57. preserve_default=True,
  58. ),
  59. ]