Exemple #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)),
            ],
        ),
    ]
Exemple #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)),
            ],
        ),
    ]
Exemple #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Contacts',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('first_name', models.CharField(max_length=255)),
                ('last_name',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('other_name', models.CharField(max_length=255)),
                ('phone_number',
                 models.CharField(max_length=12,
                                  unique=True,
                                  validators=[contacts.models.validate_phone
                                              ])),
            ],
            options={
                'ordering': ['first_name', 'last_name'],
                'unique_together':
                {('first_name', 'last_name', 'phone_number')},
            },
        ),
    ]
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',),
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('contacts', '0002_auto_20200507_1657'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', contacts.models.NameField(max_length=50,
                                                   unique=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.AddField(
            model_name='contact',
            name='email',
            field=models.EmailField(blank=True, max_length=254, null=True),
        ),
        migrations.AddField(
            model_name='contact',
            name='gender',
            field=models.CharField(blank=True,
                                   choices=[('m', 'male'), ('f', 'female')],
                                   max_length=50),
        ),
        migrations.AddField(
            model_name='contact',
            name='is_active',
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name='contact',
            name='last_updated',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='contact',
            name='time_created',
            field=models.DateTimeField(auto_now_add=True,
                                       default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='ContactTag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('contact',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='contacts.Contact')),
                ('tag',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='contacts.Tag')),
            ],
        ),
    ]