Пример #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('HomePage', '0010_auto_20200326_1125'),
    ]

    operations = [
        migrations.CreateModel(
            name='Health',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_photo',
                 models.ImageField(blank=True,
                                   upload_to='health',
                                   validators=[HomePage.models.validate_image
                                               ])),
                ('category',
                 models.CharField(choices=[('Fitness', 'Fitness'),
                                           ('Diet', 'Diet'), ('Yoga', 'Yoga'),
                                           ('Health & Wellness',
                                            'Health & Wellness'),
                                           ('Naturopathy', 'Naturopathy')],
                                  max_length=250)),
                ('heading', models.CharField(max_length=250)),
                ('paragraph', models.TextField()),
                ('user_name', models.CharField(max_length=250)),
                ('upload_date', models.DateField()),
            ],
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('HomePage', '0028_auto_20200401_1951'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfilePostMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_post_message', models.TextField()),
                ('user_post_image',
                 models.ImageField(
                     blank=True,
                     help_text=
                     'The images files size must be greater than 200kb and less than 500kb. The dimensions of the photograph should be 800 (width) x 800 (height)',
                     upload_to='user_posts/user_post_images',
                     validators=[HomePage.models.validate_image])),
                ('user_post_location',
                 models.CharField(default='New Delhi', max_length=250)),
                ('user_post_date', models.DateField(auto_now_add=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.DeleteModel(name='UserPostMessage', ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('HomePage', '0011_health'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserPostMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_message', models.TextField()),
                ('user_post_image',
                 models.ImageField(
                     blank=True,
                     help_text=
                     'The images files size must be greater than 200kb and less than 500kb. The dimensions of the photograph should be 800 (width) x 800 (height)',
                     upload_to='user_posts/user_post_images',
                     validators=[HomePage.models.validate_image])),
                ('user_post_url',
                 models.URLField(
                     blank=True,
                     help_text=
                     'Note: Add https:// in the URL, Example: https://youtu.be/r2Hvxr7esNM ',
                     unique=True)),
                ('user_post_attachment',
                 models.FileField(upload_to='user_posts/user_post_documents')),
                ('user_post_location', models.CharField(max_length=250)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('HomePage', '0021_delete_userprofileinfo'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfileInfo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_gender',
                 models.CharField(choices=[('Female', 'Female'),
                                           ('Male', 'Male'),
                                           ('Others', 'Others')],
                                  max_length=20)),
                ('user_age',
                 models.DateField(blank=True, default=datetime.datetime.now)),
                ('user_profile_image',
                 models.ImageField(
                     blank=True,
                     help_text=
                     'The images files size must be greater than 200kb and less than 500kb. The dimensions of the photograph should be 800 (width) x 800 (height)',
                     upload_to='profile_image',
                     validators=[HomePage.models.validate_image])),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status',
                 models.CharField(choices=[('FOR SALE', 'For Sale'),
                                           ('FOR RENT', 'For Rent')],
                                  max_length=10)),
                ('price', models.CharField(max_length=20)),
                ('address', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('date_posted',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('likes',
                 models.ManyToManyField(related_name='blog_posts',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PostImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.FileField(upload_to=HomePage.models.get_image_filename,
                                  verbose_name='Image')),
                ('post',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='HomePage.post')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('body', models.TextField()),
                ('date_added', models.DateTimeField(auto_now_add=True)),
                ('post',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='HomePage.post')),
            ],
        ),
    ]