Exemplo n.º 1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('taggit', '0003_taggeditem_add_unique_index'),
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('avatar', models.ImageField(blank=True, upload_to='profiles/avatars/', verbose_name='avatar')),
                ('name', models.CharField(blank=True, max_length=300, verbose_name='name')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('specialization', models.CharField(blank=True, max_length=100, verbose_name='specialization')),
                ('description', models.TextField(blank=True, max_length=1000, verbose_name='description')),
                ('settings', models.JSONField(blank=True, default=apps.profiles.models.default_settings, verbose_name='settings')),
                ('excluded_feed_tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='description',
            field=models.CharField(blank=True, max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='profile',
            name='avatar',
            field=models.ImageField(blank=True,
                                    upload_to=apps.profiles.models.url),
        ),
    ]
Exemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('blog', '0003_auto_20201217_0312'),
        ('profiles', '0002_auto_20201217_0312'),
    ]

    operations = [
        migrations.AddField(
            model_name='contributor_profile',
            name='likes',
            field=models.ManyToManyField(blank=True, related_name='likes', to='blog.BlogPost'),
        ),
        migrations.AddField(
            model_name='reader_profile',
            name='gender',
            field=models.CharField(choices=[('MALE', 'Male'), ('FEMALE', 'Female')], default='', max_length=20),
        ),
        migrations.AddField(
            model_name='reader_profile',
            name='is_active',
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name='reader_profile',
            name='likes',
            field=models.ManyToManyField(blank=True, related_name='liked_by', to='blog.BlogPost'),
        ),
        migrations.AlterField(
            model_name='contributor_profile',
            name='image',
            field=models.FileField(default='default.jpeg', upload_to=apps.profiles.models.contributor_photo_path),
        ),
        migrations.AlterField(
            model_name='reader_profile',
            name='image',
            field=models.FileField(default='default.jpeg', upload_to=apps.profiles.models.reader_photo_path),
        ),
    ]
Exemplo n.º 4
0
class Migration(migrations.Migration):

    dependencies = [
        ('profiles', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='contributor_profile',
            name='gender',
            field=models.CharField(choices=[('MALE', 'Male'),
                                            ('FEMALE', 'Female')],
                                   default='',
                                   max_length=20),
        ),
        migrations.AlterField(
            model_name='contributor_profile',
            name='image',
            field=models.FileField(
                default='default_imgs/default_male.jpg',
                upload_to=apps.profiles.models.contributor_photo_path),
        ),
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('blog', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Reader_Profile',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('username', models.CharField(max_length=200, unique=True)),
                ('first_name', models.CharField(max_length=50)),
                ('date_of_birth', models.DateField()),
                ('email', models.EmailField(max_length=254)),
                ('image',
                 models.FileField(
                     default='default.jpg',
                     upload_to=apps.profiles.models.reader_photo_path)),
                ('password', models.CharField(max_length=200)),
                ('social_media_platform',
                 models.CharField(choices=[('TW', 'Twitter'),
                                           ('FB', 'Facebook'),
                                           ('IG', 'Instagram'),
                                           ('PT', 'Pintrest'),
                                           ('TB', 'Tmblr')],
                                  default='FB',
                                  max_length=30)),
                ('social_media_handles',
                 models.CharField(default='@Username', max_length=50)),
            ],
            options={
                'verbose_name': 'Reader Profile',
                'verbose_name_plural': 'Reader Profiles',
            },
        ),
        migrations.CreateModel(
            name='Contributor_Profile',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('username', models.CharField(max_length=200, unique=True)),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('date_of_birth', models.DateField()),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('phone_number', models.CharField(max_length=14)),
                ('is_active', models.BooleanField(default=True)),
                ('image',
                 models.FileField(
                     default='default.jpg',
                     upload_to=apps.profiles.models.contributor_photo_path)),
                ('password', models.CharField(max_length=200)),
                ('social_media_platform',
                 models.CharField(choices=[('TW', 'Twitter'),
                                           ('FB', 'Facebook'),
                                           ('IG', 'Instagram'),
                                           ('PT', 'Pintrest'),
                                           ('TB', 'Tumblr')],
                                  default='FB',
                                  max_length=50)),
                ('social_media_handles', models.CharField(max_length=50)),
                ('blog_post',
                 models.ForeignKey(
                     blank=True,
                     max_length=1000,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='blog.blogpost')),
            ],
            options={
                'verbose_name': 'Contributor Profile',
                'verbose_name_plural': 'Contributor Profiles',
            },
        ),
    ]