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

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstname', models.CharField(max_length=30)),
                ('lastname', models.CharField(blank=True, max_length=40, null=True)),
                ('secondname', models.CharField(blank=True, max_length=30, null=True)),
                ('mobile', models.CharField(max_length=15, validators=[django.core.validators.RegexValidator(code='invalid_mobile', message="Phone number must be entered in the format: '+380(67)9999999'. Up to 15 digits allowed.", regex='^\\+380\\([0-9]{2}\\)[0-9]{7}$')])),
                ('personal_phone', models.CharField(blank=True, max_length=15, null=True)),
                ('business_phone', models.CharField(blank=True, max_length=4, null=True)),
                ('company', models.CharField(blank=True, max_length=15, null=True)),
                ('position', models.TextField(blank=True, null=True)),
                ('address', models.TextField(blank=True, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('star', models.BooleanField(default=False)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ContactPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.ImageField(blank=True, null=True, upload_to=contacts.models.user_directory_path)),
                ('thumbnail', models.ImageField(blank=True, editable=False, null=True, upload_to=contacts.models.user_directory_path)),
                ('load_date', models.DateTimeField(auto_now_add=True)),
                ('active', models.BooleanField(default=False)),
                ('contact', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact')),
            ],
            options={
                'ordering': ['-load_date'],
            },
        ),
        migrations.CreateModel(
            name='Dublicate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.SmallIntegerField()),
                ('contact_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contacts.Contact')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=20)),
                ('last_name', models.CharField(blank=True, max_length=20)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Exemplo n.º 2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('address', models.TextField(blank=True)),
                ('work_phone', models.CharField(max_length=15)),
                ('profile_image',
                 models.ImageField(
                     blank=True,
                     upload_to=contacts.models.contact_picture_directory_path)
                 ),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.AddField(
            model_name='contacts',
            name='height_field',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='contacts',
            name='image',
            field=models.ImageField(blank=True,
                                    height_field='height_field',
                                    null=True,
                                    upload_to=contacts.models.upload_location,
                                    width_field='width_field'),
        ),
        migrations.AddField(
            model_name='contacts',
            name='width_field',
            field=models.IntegerField(default=0),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('contacts', '0003_auto_20160206_2144'),
    ]

    operations = [
        migrations.AddField(
            model_name='contact',
            name='avatar',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=contacts.models.contact_directory_path),
        ),
        migrations.AlterField(
            model_name='contact',
            name='email',
            field=models.EmailField(blank=True, max_length=20, null=True),
        ),
        migrations.AlterField(
            model_name='contact',
            name='telephone_number',
            field=models.CharField(blank=True, max_length=20, null=True),
        ),
        migrations.RunPython(add_avatars)
    ]
Exemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        ('contacts', '0007_remove_contact_slug'),
    ]

    operations = [
        migrations.AddField(
            model_name='contact',
            name='image',
            field=models.ImageField(default='contacts/default.jpg', upload_to=contacts.models.upload_to, verbose_name='Image'),
        ),
    ]
Exemplo n.º 6
0
class Migration(migrations.Migration):

    dependencies = [
        ('contacts', '0008_extra_email_prefix'),
    ]

    operations = [
        migrations.AddField(
            model_name='extra',
            name='photo',
            field=models.ImageField(
                blank=True,
                help_text='如要要办理校友卡,请上传证件照。',
                upload_to=contacts.models.get_photo_upload_path,
                verbose_name='校友卡证件照'),
        ),
    ]
Exemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Contact',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('slug', models.SlugField(blank=True, max_length=200, null=True)),
                ('mobile', models.CharField(blank=True, max_length=20, null=True, validators=[contacts.validators.validate_phone_number])),
                ('email', models.EmailField(blank=True, max_length=100, null=True)),
                ('address', models.CharField(blank=True, max_length=100, null=True)),
                ('image', models.ImageField(upload_to=contacts.models.image_path)),
                ('profession', models.CharField(max_length=100)),
                ('status', models.CharField(choices=[('unshare', 'Unshare'), ('share', 'Share')], default='share', max_length=20)),
                ('linkedin_url', models.CharField(blank=True, max_length=200, null=True)),
                ('facebook_url', models.CharField(blank=True, max_length=200, null=True)),
                ('Github_url', models.CharField(blank=True, max_length=200, null=True)),
                ('bio_url', models.CharField(blank=True, max_length=200, null=True)),
                ('url', models.CharField(blank=True, max_length=200, null=True)),
                ('views', models.IntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='blog_posts', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Contact',
                'verbose_name_plural': 'Contacts',
                'ordering': ('-created',),
            },
        ),
    ]