コード例 #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0023_auto_20190923_0930'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='photo_height',
            field=models.PositiveIntegerField(blank=True, default=0),
        ),
        migrations.AddField(
            model_name='profile',
            name='photo_width',
            field=models.PositiveIntegerField(blank=True, default=0),
        ),
        migrations.AlterField(
            model_name='profile',
            name='avatar',
            field=models.ImageField(
                blank=True,
                default='placeholder/default.png',
                height_field='avatar_height',
                max_length=255,
                null=True,
                upload_to=accounts.models.user_directory_path,
                verbose_name={'rotations': None},
                width_field='avatar_width'),
        ),
    ]
コード例 #2
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0026_auto_20190923_1053'),
    ]

    operations = [
        migrations.AddField(
            model_name='profile',
            name='avatar_crop',
            field=models.ImageField(
                blank=True,
                default='',
                height_field='avatar__crop_height',
                max_length=255,
                null=True,
                upload_to=accounts.models.user_directory_path,
                width_field='avatar_crop_width'),
        ),
        migrations.AddField(
            model_name='profile',
            name='avatar_crop_height',
            field=models.PositiveIntegerField(blank=True, default=0),
        ),
        migrations.AddField(
            model_name='profile',
            name='avatar_crop_width',
            field=models.PositiveIntegerField(blank=True, default=0),
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0017_auto_20200815_1658'),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('order_useremail',
                 models.EmailField(default=None, max_length=254)),
                ('order_name', models.CharField(max_length=1024)),
                ('order_image', models.ImageField(upload_to='orderimages/')),
                ('order_price', models.PositiveIntegerField()),
                ('order_publisher', models.CharField(max_length=1024)),
                ('order_origin', models.CharField(max_length=1024)),
                ('order_description', models.TextField()),
                ('order_quantity', models.PositiveIntegerField(default=1)),
                ('order_total_price', models.PositiveIntegerField(default=0)),
                ('order_delivery_date',
                 models.DateTimeField(
                     default=accounts.models.return_datetime)),
            ],
        ),
        migrations.RemoveField(
            model_name='addtocart',
            name='cart_slug',
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('company', '0017_remitamandatestatusreport'),
        ('accounts', '0007_thirdpartycreds_remita_dd_api_token'),
    ]

    operations = [
        migrations.CreateModel(
            name='BankAccountType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=128, null=True)),
                ('maximum_withdrawal_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('annual_interest_rate', models.DecimalField(decimal_places=2, help_text='Interest rate from 0 - 100', max_digits=5, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)])),
                ('interest_calculation_per_year', models.PositiveSmallIntegerField(help_text='The number of times interest will be calculated per year', validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)])),
            ],
        ),
        migrations.AlterModelManagers(
            name='user',
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='UserBankAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('account_no', models.PositiveIntegerField(unique=True)),
                ('gender', models.CharField(choices=[('M', 'Male'), ('F', 'Female')], max_length=1)),
                ('birth_date', models.DateField(blank=True, null=True)),
                ('balance', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('interest_start_date', models.DateField(blank=True, help_text='The month number that interest calculation will start from', null=True)),
                ('initial_deposit_date', models.DateField(blank=True, null=True)),
                ('account_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accounts', to='accounts.BankAccountType')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='company.Company')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='account', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('street_address', models.CharField(max_length=512)),
                ('city', models.CharField(max_length=256)),
                ('postal_code', models.PositiveIntegerField()),
                ('country', models.CharField(max_length=256)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='address', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #5
0
ファイル: 0001_initial.py プロジェクト: heping945/blogbackend
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.UUIDField(auto_created=True, default=accounts.models.create_uuid, editable=False, primary_key=True, serialize=False)),
                ('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')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('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')),
                ('nickname', models.CharField(blank=True, max_length=32, null=True, verbose_name='昵称')),
                ('gender', models.IntegerField(choices=[(1, '男'), (0, '女'), (-1, '未知')], default=-1, verbose_name='性别')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='居住地')),
                ('birth_date', models.DateField(blank=True, null=True, verbose_name='生日')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True, verbose_name='邮箱')),
                ('phone', models.CharField(blank=True, max_length=11, null=True, unique=True, verbose_name='手机')),
                ('desc', models.CharField(blank=True, max_length=250, null=True, verbose_name='个人描述')),
                ('avatar', models.ImageField(blank=True, default='/avatars/default.png', upload_to=accounts.models.user_directory_path, verbose_name='头像')),
                ('headline', models.CharField(blank=True, max_length=30, null=True, verbose_name='简介')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('mod_date', models.DateTimeField(auto_now=True, verbose_name='上次更新时间')),
                ('answer_count', models.PositiveIntegerField(default=0, verbose_name='回答数')),
                ('articles_count', models.PositiveIntegerField(default=0, verbose_name='文章数')),
                ('follower_count', models.PositiveIntegerField(default=0, verbose_name='关注者数')),
                ('following_count', models.PositiveIntegerField(default=0, verbose_name='关注人数')),
                ('urltoken', models.SlugField(blank=True, max_length=60, verbose_name='urltoken')),
                ('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': '用户账户',
                'verbose_name_plural': '用户账户',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
コード例 #6
0
ファイル: 0001_initial.py プロジェクト: GeeTech-Lab/nwaben
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(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')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('username', models.CharField(max_length=40, unique=True)),
                ('bio', models.CharField(blank=True, default='', max_length=240)),
                ('avatar', models.ImageField(blank=True, help_text='You profile image', null=True, storage=nwaben.storage_backends.PublicMediaStorage(), upload_to=accounts.models.upload_dir)),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(max_length=128, region=None)),
                ('gender', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female')], max_length=6, null=True)),
                ('follow_count', models.PositiveIntegerField(default=0)),
                ('date_joined', models.DateTimeField(auto_now_add=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('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={
                'abstract': False,
            },
        ),
    ]
コード例 #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('birthdate', models.DateField(blank=True, null=True)),
                ('phone', models.CharField(blank=True,
                                           max_length=20,
                                           null=True)),
                ('address', models.TextField(blank=True, null=True)),
                ('balance', models.PositiveIntegerField(default=0)),
                ('profile_image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=accounts.models.path_and_rename)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #8
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0001_squashed_0005_auto_20210123_2307'),
    ]

    operations = [
        migrations.AddField(
            model_name='userdata',
            name='age',
            field=models.PositiveIntegerField(default=18),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='userdata',
            name='job',
            field=models.CharField(default='Tech', max_length=20),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='userdata',
            name='charity_preference',
            field=accounts.models.IntegerRangeField(),
        ),
        migrations.AlterField(
            model_name='userdata',
            name='checkpoints',
            field=models.JSONField(),
        ),
        migrations.AlterField(
            model_name='userdata',
            name='fund_preference',
            field=models.JSONField(),
        ),
        migrations.AlterField(
            model_name='userdata',
            name='salary',
            field=models.PositiveIntegerField(),
        ),
        migrations.AlterField(
            model_name='userdata',
            name='salary_preference',
            field=accounts.models.IntegerRangeField(),
        ),
    ]
コード例 #9
0
class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('accounts', '0011_auto_20181224_2232'),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('status',
                 models.CharField(choices=[('annonce', 'an annonce'),
                                           ('reply', 'a reply'),
                                           ('message', 'a message')],
                                  default='message',
                                  max_length=20)),
                ('seen', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('content_type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='notifications',
                                   to='contenttypes.ContentType')),
            ],
            options={
                'verbose_name': 'Notification',
                'verbose_name_plural': 'Notifications',
                'ordering': ['-created'],
            },
            bases=(models.Model, accounts.models.ContentTypeToGetModel),
        ),
        migrations.RemoveField(
            model_name='user',
            name='notifications',
        ),
        migrations.AddField(
            model_name='notification',
            name='receiver',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='notification_receiver',
                to=settings.AUTH_USER_MODEL),
        ),
    ]
コード例 #10
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CityOption',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city_name', models.CharField(blank=True, max_length=100, verbose_name='Nombre de la ciudad')),
                ('postal_code', models.CharField(blank=True, max_length=20, verbose_name='Código postal')),
                ('state', models.CharField(blank=True, max_length=100, verbose_name='Estado, provincia o departamento')),
                ('country', models.CharField(blank=True, max_length=100, verbose_name='País')),
                ('address_region', models.CharField(blank=True, max_length=20, verbose_name='Región usando el formato ISO 3166-1 Ej. SV, AR, MX.')),
            ],
            options={
                'verbose_name': 'Ciudad',
                'verbose_name_plural': 'Ciudades',
                'ordering': ['city_name'],
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('degree', models.CharField(blank=True, help_text='Escribe tu último título académico ej. "Doctorado en medicina".', max_length=100, verbose_name='Profesión o título académico')),
                ('abbreviation', models.CharField(blank=True, max_length=20, verbose_name='Abreviatura de tu nivel académico')),
                ('academic_abbreviation_visible', models.BooleanField(default=False, help_text='La abreviatura de tu nivel académico será visible junto con tu nombre.', verbose_name='Abreviatura de tu nivel académico visible')),
                ('speciality', models.CharField(blank=True, help_text='Escribe la especialidad que desempeñas, si la posees.', max_length=100, verbose_name='Especialidad en tu profesión')),
                ('gender', models.CharField(blank=True, choices=[('hombre', 'hombre'), ('mujer', 'mujer'), ('otro', 'otro')], max_length=6, verbose_name='Sexo')),
                ('country', models.CharField(blank=True, max_length=100, verbose_name='País')),
                ('city', models.CharField(blank=True, max_length=100, verbose_name='Ciudad')),
                ('description', models.TextField(blank=True, help_text='Pequeña introducción de ti, máximo 2000 caracteres.', max_length=2000, null=True, verbose_name='Descripción')),
                ('website', models.URLField(blank=True, verbose_name='Sitio web')),
                ('birthday', models.DateField(blank=True, null=True)),
                ('phone', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, region=None, verbose_name='+503 2502 6108')),
                ('whatsapp', phonenumber_field.modelfields.PhoneNumberField(blank=True, max_length=128, region=None, verbose_name='WhatsApp ej. +503 7390 5006')),
                ('image', models.ImageField(blank=True, upload_to=accounts.models.profile_picture_directory_path)),
                ('last_updated', models.DateTimeField(auto_now_add=True)),
                ('views', models.PositiveIntegerField(blank=True, default=0)),
                ('is_instructor', models.BooleanField(default=False)),
                ('slug', models.SlugField(blank=True, help_text='URL personalizada para el perfil.', max_length=255, null=True, verbose_name='URL del perfil')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #11
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.BigAutoField(auto_created=True,
                                     primary_key=True,
                                     serialize=False,
                                     verbose_name='ID')),
                ('profile_pic',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=accounts.models.upload_location)),
                ('post_limit', models.PositiveIntegerField(default=2)),
                ('update_limit', models.PositiveIntegerField(default=2)),
                ('website_url', models.URLField(blank=True, null=True)),
                ('facebook_url', models.URLField(blank=True, null=True)),
                ('instagram_url', models.URLField(blank=True, null=True)),
                ('youtube_url', models.URLField(blank=True, null=True)),
                ('group_name', models.CharField(default='staff',
                                                max_length=60)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #12
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Farm',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=24, unique=True)),
                ('addr', models.CharField(blank=True, max_length=64)),
                ('phone', models.CharField(blank=True, max_length=16)),
                ('subject', models.CharField(blank=True, max_length=128)),
                ('price', models.PositiveIntegerField(default=0)),
                ('desc', models.TextField(blank=True, null=True)),
                ('notice',
                 models.TextField(blank=True, max_length=1024, null=True)),
                ('is_delete', models.BooleanField(default=False)),
                ('created_date', models.DateField(auto_now_add=True)),
                ('updated_date', models.DateField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='FarmImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=accounts.models.user_directory_path)),
                ('is_delete', models.BooleanField(default=False)),
                ('created_date', models.DateField(auto_now_add=True)),
                ('updated_date', models.DateField(auto_now=True)),
                ('flags', models.IntegerField(db_index=True, default=0)),
                ('farm',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='farm.Farm')),
            ],
        ),
    ]
コード例 #13
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Bus',
            fields=[
                ('busid', models.PositiveIntegerField(primary_key=True, serialize=False)),
                ('busname', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='StartTime',
            fields=[
                ('startid', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('startdate', models.DateField()),
                ('starttime', models.TimeField()),
                ('busid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Bus')),
            ],
        ),
        migrations.CreateModel(
            name='Seat',
            fields=[
                ('seatid', models.IntegerField(primary_key=True, serialize=False)),
                ('seatrow', models.IntegerField()),
                ('seatcol', models.CharField(max_length=11)),
                ('status', models.BooleanField(default=False)),
                ('startid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.StartTime')),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('reservationid', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('busid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Bus')),
                ('seatid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Seat')),
                ('startid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.StartTime')),
                ('username', models.ForeignKey(default=accounts.models.User, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #14
0
class Order(models.Model):
    total_price = models.PositiveIntegerField(default=0)
    date_created = models.DateTimeField(auto_now_add=True)
    table = models.ForeignKey(Table, on_delete=models.SET_NULL, null=True)
    status = models.CharField(choices=(('ready', 'ready'), ('in_process',
                                                            'in_process'),
                                       ('closed', 'closed')),
                              max_length=20,
                              default='in_process')
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    payment_type = models.CharField(choices=(('card', 'card'), ('cash',
                                                                'cash')),
                                    max_length=5,
                                    default='cash')
    promocode = models.CharField(max_length=10,
                                 blank=True,
                                 null=True,
                                 default=1)
コード例 #15
0
class Migration(migrations.Migration):

    replaces = [('accounts', '0001_initial'),
                ('accounts', '0002_auto_20210123_1841'),
                ('accounts', '0003_userdata_checkpoints'),
                ('accounts', '0004_auto_20210123_2306'),
                ('accounts', '0005_auto_20210123_2307')]

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserData',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('charity_preference',
                 accounts.models.IntegerRangeField(default=5)),
                ('fund_preference',
                 models.JSONField(default={'email': '*****@*****.**'})),
                ('salary', models.PositiveIntegerField(default=30)),
                ('salary_preference',
                 accounts.models.IntegerRangeField(default=10)),
                ('checkpoints', models.JSONField(default={'Test': 1})),
                ('current_investment',
                 models.JSONField(
                     default=accounts.models.current_investment_default)),
            ],
            options={
                'ordering': ['user'],
                'verbose_name_plural': 'User data',
            },
        ),
    ]
コード例 #16
0
class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0040_auto_20210131_1518'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('porder_useremail',
                 models.EmailField(default=None, max_length=254)),
                ('porder_name', models.CharField(max_length=1024)),
                ('porder_price', models.PositiveIntegerField()),
                ('porder_publisher', models.CharField(max_length=1024)),
                ('porder_origin', models.CharField(max_length=1024)),
                ('porder_domain',
                 models.CharField(default='null', max_length=100)),
                ('porder_phonenumber',
                 models.IntegerField(default=9061325108)),
                ('ppaymentstatus',
                 models.CharField(default=False, max_length=100)),
                ('porder_ordered_date',
                 models.DateTimeField(
                     default=datetime.datetime(2021, 2, 1, 18, 57, 52, 339463))
                 ),
                ('porder_delivery_date',
                 models.DateTimeField(
                     default=accounts.models.return_datetime)),
            ],
        ),
        migrations.AlterField(
            model_name='order',
            name='order_ordered_date',
            field=models.DateTimeField(
                default=datetime.datetime(2021, 2, 1, 18, 57, 52, 339463)),
        ),
    ]
コード例 #17
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('accounts', '0001_initial'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='userdata',
            name='happy',
        ),
        migrations.AddField(
            model_name='userdata',
            name='charity_preference',
            field=accounts.models.IntegerRangeField(default=5),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='userdata',
            name='fund_preference',
            field=models.JSONField(default={'email': '*****@*****.**'}),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='userdata',
            name='salary',
            field=models.PositiveIntegerField(default=30),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='userdata',
            name='salary_preference',
            field=accounts.models.IntegerRangeField(default=10),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='userdata',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
コード例 #18
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.IntegerField(default=accounts.models.get_random_id, editable=False, primary_key=True, serialize=False)),
                ('balance', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, verbose_name='Balance')),
                ('currency', models.PositiveIntegerField(choices=[(0, 'EUR'), (1, 'USD'), (2, 'GBP'), (3, 'CHF')], default=0, verbose_name='Currency')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Create time')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='account_owner', to=settings.AUTH_USER_MODEL, verbose_name='Account Owner')),
            ],
        ),
    ]
コード例 #19
0
class Assignment(ModelMeta, models.Model):

    title = models.CharField(_('title'), max_length=256)
    description = models.TextField(_('description'),
                                   blank=True,
                                   null=True,
                                   max_length=256)
    deadline = models.DateTimeField(_("deadline"))
    created = models.DateTimeField(auto_now_add=True)
    modified = models.DateTimeField(auto_now=True)
    course_offering = models.ForeignKey('course.CourseOffering',
                                        on_delete=models.CASCADE)
    slug = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
    points = models.PositiveIntegerField(_("points"), default=0)

    _metadata = {
        'title': 'get_meta_assignment_title',
        'description': 'get_meta_assignment_description',
    }

    def get_meta_assignment_title(self):
        return get_site_title(
            f'{ self.title } - { self.course_offering.course.code }')

    def get_meta_assignment_description(self):
        return self.description[:120] + (self.description[120:] and '..')

    def __str__(self):
        return '{} - {}'.format(self.course_offering, self.title)

    def get_absolute_url(self):
        return reverse('assignment:detail', kwargs={'slug': self.slug})

    @property
    def is_not_in_deadline(self):
        return self.deadline < datetime.datetime.now(self.deadline.tzinfo)
コード例 #20
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('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')),
                ('nickname', models.CharField(max_length=300)),
                ('image',
                 models.ImageField(
                     default='Bunny-avatar.gif',
                     upload_to=accounts.models.user_media_upload_handler)),
                ('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')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Awardance',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Merit',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image', models.ImageField(upload_to='')),
                ('stage', models.PositiveSmallIntegerField()),
                ('title', models.CharField(max_length=256)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('life_clicks', models.PositiveIntegerField(default=1)),
            ],
        ),
        migrations.AddField(
            model_name='awardance',
            name='merit',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='recognitions',
                to='accounts.Merit'),
        ),
        migrations.AddField(
            model_name='awardance',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='awards',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='merits',
            field=models.ManyToManyField(blank=True,
                                         related_name='users',
                                         through='accounts.Awardance',
                                         to='accounts.Merit'),
        ),
        migrations.AddField(
            model_name='user',
            name='profile',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='accounts.Profile'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=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'),
        ),
    ]
コード例 #21
0
ファイル: 0001_initial.py プロジェクト: RealScatman/ruelala
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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')),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('full_name',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('active', models.BooleanField(default=True)),
                ('is_active', models.BooleanField(default=False)),
                ('is_member',
                 models.BooleanField(default=False,
                                     verbose_name='Is Subscriber')),
                ('staff', models.BooleanField(default=False)),
                ('admin', models.BooleanField(default=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('confirmed',
                 models.BooleanField(default=False,
                                     verbose_name='Is Confirmed Lawyer')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BoxSelection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subtotal',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=100)),
                ('total',
                 models.DecimalField(decimal_places=2,
                                     default=0.0,
                                     max_digits=100)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='DigitalPlan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.PositiveIntegerField(default=19999)),
                ('interval', models.CharField(default='month',
                                              max_length=120)),
                ('interval_count', models.CharField(default='1',
                                                    max_length=120)),
                ('currency', models.CharField(default='usd', max_length=60)),
                ('plan_id',
                 models.CharField(blank=True, max_length=120, null=True)),
                ('stripe_plan', models.TextField(blank=True, null=True)),
                ('active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='GuestEmail',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
                ('active', models.BooleanField(default=True)),
                ('update', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=accounts.models.upload_image_path)),
                ('price', models.DecimalField(decimal_places=2,
                                              max_digits=20)),
                ('active', models.BooleanField(default=True)),
                ('products',
                 models.ManyToManyField(blank=True, to='products.Product')),
            ],
        ),
        migrations.AddField(
            model_name='digitalplan',
            name='subscription',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='accounts.Subscription'),
        ),
        migrations.AddField(
            model_name='boxselection',
            name='subscription',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='accounts.Subscription'),
        ),
        migrations.AddField(
            model_name='boxselection',
            name='user',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
コード例 #22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserAccount',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('is_student', models.BooleanField()),
                ('is_teacher', models.BooleanField()),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('last_login',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('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={
                'abstract': False,
            },
            managers=[
                ('objects', accounts.models.UserAccountManager()),
            ],
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('award_points', models.PositiveIntegerField(default=0)),
                ('birthdate', models.DateField(blank=True, null=True)),
                ('picture',
                 models.ImageField(blank=True, null=True, upload_to='')),
                ('phone_number',
                 models.CharField(
                     blank=True,
                     max_length=17,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.",
                             regex='^\\+?1?\\d{9,15}$')
                     ])),
                ('date_of_birth', models.DateField(blank=True, null=True)),
                ('city',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user_city',
                                   to='accounts.city')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #23
0
ファイル: 0001_initial.py プロジェクト: mathemartins/amjumfb
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('company', '0001_initial'),
        ('accounts', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PlanDetails',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=100,
                                          null=True)),
                ('max_staff', models.PositiveIntegerField(blank=True,
                                                          null=True)),
                ('maintenance_fee', models.IntegerField(blank=True,
                                                        null=True)),
                ('price', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Pricing Plan',
                'verbose_name_plural': 'Pricing Plans',
            },
        ),
        migrations.CreateModel(
            name='Subscribers',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email', models.EmailField(max_length=255, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Subscribers',
                'verbose_name_plural': 'Subscribers',
            },
        ),
        migrations.CreateModel(
            name='SupportTickets',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=300)),
                ('content', models.TextField()),
                ('ticket_id',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('completed', models.BooleanField(default=False)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('affected_company',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='company.Company')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Profile')),
            ],
            options={
                'verbose_name': 'Support Ticket',
                'verbose_name_plural': 'Support Ticket',
                'ordering': ('-timestamp', '-updated'),
            },
        ),
        migrations.CreateModel(
            name='Messages',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('to_all', models.BooleanField(default=False)),
                ('from_obj',
                 models.CharField(default='Mincore Systems', max_length=300)),
                ('title',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('image',
                 cloudinary.models.CloudinaryField(
                     blank=True,
                     max_length=255,
                     null=True,
                     verbose_name=accounts.models.upload_image_path)),
                ('content', models.TextField()),
                ('url', models.URLField(blank=True, null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('to_obj',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='company.Company')),
            ],
            options={
                'verbose_name': 'messages',
                'verbose_name_plural': 'messages',
            },
        ),
    ]
コード例 #24
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('borrowers', '0001_initial'),
        ('company', '0001_initial'),
        ('accounts', '0002_auto_20200517_1005'),
        ('minmarkets', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Collateral',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=300,
                                          null=True)),
                ('registered_date', models.DateTimeField(blank=True,
                                                         null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('status',
                 models.CharField(blank=True,
                                  choices=[('Deposited In Branch',
                                            'Deposited In Branch'),
                                           ('Collateral With Borrower',
                                            'Collateral With Borrower'),
                                           ('Returned To Borrower',
                                            'Returned To Borrower'),
                                           ('Sold', 'Sold'), ('Lost', 'Lost')],
                                  default='OPEN',
                                  max_length=40,
                                  null=True)),
                ('value',
                 models.CharField(blank=True,
                                  help_text='Object Worth',
                                  max_length=300,
                                  null=True)),
                ('condition',
                 models.TextField(blank=True,
                                  help_text='Describe status of object',
                                  null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('image',
                 cloudinary.models.CloudinaryField(
                     blank=True,
                     max_length=255,
                     null=True,
                     verbose_name=accounts.models.upload_image_path)),
            ],
            options={
                'verbose_name': 'Collateral',
                'verbose_name_plural': 'Collateral',
            },
        ),
        migrations.CreateModel(
            name='CollateralFiles',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('file',
                 cloudinary.models.CloudinaryField(
                     blank=True,
                     max_length=255,
                     null=True,
                     verbose_name=accounts.models.upload_image_path)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Collateral File',
                'verbose_name_plural': 'Collateral Files',
            },
        ),
        migrations.CreateModel(
            name='CollateralType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=300,
                                          null=True)),
                ('description', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Collateral Type',
                'verbose_name_plural': 'Collateral Type',
            },
        ),
        migrations.CreateModel(
            name='Penalty',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('describe', models.TextField()),
                ('punishment_fee',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('re_occuring', models.BooleanField(default=False)),
                ('value_on_period',
                 models.IntegerField(blank=True, default=7, null=True)),
                ('period',
                 models.CharField(blank=True,
                                  choices=[('Per Year', 'Per Year'),
                                           ('Per Month', 'Per Month'),
                                           ('Per Week', 'Per Week'),
                                           ('Per Day', 'Per Day')],
                                  default='Per Month',
                                  max_length=20,
                                  null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('company',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='company.Company')),
            ],
            options={
                'verbose_name': 'Penalty',
                'verbose_name_plural': 'Penalties',
            },
        ),
        migrations.CreateModel(
            name='ModeOfRepayments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Mode Of Repayment',
                'verbose_name_plural': 'Mode Of Repayments',
            },
        ),
        migrations.CreateModel(
            name='LoanType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('bought_by', models.ManyToManyField(to='accounts.Profile')),
                ('package',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Type',
                'verbose_name_plural': 'Loan Type',
            },
        ),
        migrations.CreateModel(
            name='LoanTerms',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('company',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='company.Company')),
                ('package',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='minmarkets.LoanPackage')),
            ],
            options={
                'verbose_name': 'Loan Terms',
                'verbose_name_plural': 'Loan Terms',
            },
        ),
        migrations.CreateModel(
            name='Loan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('loan_key',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('principal_amount',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('balance_due',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('interest', models.PositiveIntegerField(blank=True,
                                                         null=True)),
                ('interest_period',
                 models.CharField(blank=True,
                                  choices=[('Per Year', 'Per Year'),
                                           ('Per Month', 'Per Month'),
                                           ('Per Week', 'Per Week'),
                                           ('Per Day', 'Per Day')],
                                  default='Per Month',
                                  max_length=20,
                                  null=True)),
                ('loan_duration_circle',
                 models.CharField(blank=True,
                                  choices=[('Years', 'Years'),
                                           ('Months', 'Months'),
                                           ('Weeks', 'Weeks'),
                                           ('Days', 'Days')],
                                  default='Months',
                                  max_length=20,
                                  null=True)),
                ('loan_duration_circle_figure',
                 models.IntegerField(default=1)),
                ('repayment_circle',
                 models.CharField(blank=True,
                                  choices=[('Yearly', 'Yearly'),
                                           ('Monthly', 'Monthly'),
                                           ('Weekly', 'Weekly'),
                                           ('Daily', 'Daily')],
                                  default='Monthly',
                                  max_length=20,
                                  null=True)),
                ('number_repayments',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('release_date',
                 models.DateTimeField(help_text='Loan Paid To Customer On:')),
                ('collection_date',
                 models.DateTimeField(
                     blank=True,
                     help_text='Each Date Loan Balance Is Been Paid Back',
                     null=True)),
                ('end_date',
                 models.DateTimeField(blank=True,
                                      help_text='Maturity Date',
                                      null=True)),
                ('processing_fee',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('grace_period',
                 models.IntegerField(default=1, help_text='Counts In Days')),
                ('insurance',
                 models.CharField(blank=True, max_length=300, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('loan_file_upload',
                 cloudinary.models.CloudinaryField(
                     blank=True,
                     max_length=255,
                     null=True,
                     verbose_name=accounts.models.upload_image_path)),
                ('active', models.BooleanField(default=True)),
                ('loan_status',
                 models.CharField(blank=True,
                                  choices=[('OPEN', 'OPEN'),
                                           ('PARTIAL', 'PARTIAL'),
                                           ('CLOSED', 'CLOSED'),
                                           ('COMPLETED', 'COMPLETED'),
                                           ('OVERDUE/EXPIRED',
                                            'OVERDUE/EXPIRED')],
                                  default='OPEN',
                                  max_length=20,
                                  null=True)),
                ('slug', models.SlugField(blank=True, null=True, unique=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('account_officer',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Profile')),
                ('borrower',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='borrowers.Borrower')),
                ('collateral',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='loans.Collateral')),
                ('company',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='company.Company')),
                ('loan_terms',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='loans.LoanTerms')),
                ('loan_type',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='loans.LoanType')),
                ('mode_of_repayments',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='loans.ModeOfRepayments')),
                ('penalty',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='loans.Penalty')),
            ],
            options={
                'verbose_name': 'loan',
                'verbose_name_plural': 'loans',
                'db_table': 'loan',
                'ordering': ('-timestamp', ),
            },
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_files',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='loans.CollateralFiles'),
        ),
        migrations.AddField(
            model_name='collateral',
            name='collateral_type',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='loans.CollateralType'),
        ),
    ]
コード例 #25
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='FAQCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='FAQuestion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('answer', models.TextField(blank=True, null=True)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.FAQCategory')),
            ],
        ),
        migrations.CreateModel(
            name='Gift',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('price', models.PositiveIntegerField(default=0)),
                ('img', models.ImageField(upload_to='Gift/')),
            ],
        ),
        migrations.CreateModel(
            name='GiftCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='GiftRequest',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_complete', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('gift',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Gift')),
            ],
        ),
        migrations.CreateModel(
            name='Membership',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('level', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='MembershipCard',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('expiration', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('membership',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='accounts.Membership')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code', models.CharField(max_length=10)),
                ('img',
                 models.ImageField(
                     blank=True,
                     null=True,
                     upload_to=accounts.models.profile_img_name)),
                ('nick_name',
                 models.CharField(blank=True, max_length=8, null=True)),
                ('sex',
                 models.CharField(blank=True,
                                  choices=[('male', '남'), ('female', '여')],
                                  max_length=10,
                                  null=True)),
                ('birth', models.DateField(blank=True, null=True)),
                ('phone', models.CharField(blank=True,
                                           max_length=20,
                                           null=True)),
                ('is_blacklist', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('reported_set',
                 models.ManyToManyField(blank=True,
                                        related_name='reported_profile_set',
                                        to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='RewardHistory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('reason', models.CharField(max_length=30)),
                ('amount', models.FloatField()),
                ('status',
                 models.CharField(choices=[('ready', '지급대기'),
                                           ('complete', '지급완료'),
                                           ('reject', '취소/거절')],
                                  default='ready',
                                  max_length=10)),
                ('is_complete', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='reward_history_set',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserReward',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('reward', models.IntegerField(default=0, editable=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='reward',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='giftrequest',
            name='history',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='accounts.RewardHistory'),
        ),
        migrations.AddField(
            model_name='giftrequest',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='gift',
            name='category',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='accounts.GiftCategory'),
        ),
    ]
コード例 #26
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MyUser',
            fields=[
                ('id', models.AutoField(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')),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('media', models.ImageField(blank=True, null=True, upload_to=accounts.models.download_profile_location)),
                ('description', models.TextField(blank=True, default='', null=True)),
                ('name', models.CharField(blank=True, default='', max_length=10, null=True)),
                ('phone', models.CharField(blank=True, default='', max_length=13, null=True)),
                ('sex', models.CharField(choices=[('male', '\ub0a8\uc790'), ('female', '\uc5ec\uc790')], max_length=15, null=True)),
                ('address', models.CharField(default='', max_length=15, null=True)),
                ('job', models.CharField(blank=True, default='', max_length=15, null=True)),
                ('birth_year', models.PositiveIntegerField(null=True)),
                ('agree_purchase_info_email', models.BooleanField(default=True)),
                ('agree_purchase_info_SMS', models.BooleanField(default=False)),
                ('agree_selling_info_email', models.BooleanField(default=True)),
                ('agree_selling_info_SMS', models.BooleanField(default=True)),
                ('agree_marketing_info_email', models.BooleanField(default=True)),
                ('agree_marketing_info_SMS', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MyUserThumbnail',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('thumb_type', models.CharField(choices=[('hd', 'HD'), ('sd', 'SD'), ('micro', 'Micro')], default='hd', max_length=20)),
                ('height', models.CharField(blank=True, max_length=20, null=True)),
                ('width', models.CharField(blank=True, max_length=20, null=True)),
                ('media', models.ImageField(blank=True, height_field='height', null=True, upload_to=accounts.models.thumbnail_location, width_field='width')),
                ('myuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Seller',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('maxWorking', models.PositiveIntegerField(default=0)),
                ('description', models.TextField(blank=True, null=True)),
                ('phone', models.CharField(max_length=12)),
                ('rating', models.DecimalField(decimal_places=2, default=0.0, max_digits=3)),
                ('is_active', models.BooleanField(default=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('total_num_heart', models.PositiveIntegerField(default=0)),
                ('type', models.CharField(choices=[('individual', '\uac1c\uc778'), ('personal_business', '\uac1c\uc778\uc0ac\uc5c5\uc790'), ('corporate_business', '\ubc95\uc778\uc0ac\uc5c5\uc790')], default='individual', max_length=20, null=True)),
                ('company_name', models.CharField(blank=True, default='', max_length=12, null=True)),
                ('representative_name', models.CharField(blank=True, default='', max_length=12, null=True)),
                ('corporate_number', models.CharField(default='', max_length=12, null=True)),
                ('business_field', models.CharField(blank=True, default='', max_length=12, null=True)),
                ('company_type', models.CharField(blank=True, default='', max_length=12, null=True)),
                ('business_license', models.ImageField(blank=True, null=True, upload_to='/Users/jaewon/Project/socialup/socialup/settings/../../media/business_license/')),
                ('account_copy', models.ImageField(blank=True, null=True, upload_to='/Users/jaewon/Project/socialup/socialup/settings/../../media/account_copy/')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SellerAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('account_number', models.CharField(blank=True, default='', max_length=120, null=True)),
                ('account_name', models.CharField(blank=True, default='', max_length=50, null=True)),
                ('bank', models.CharField(blank=True, choices=[('\uae30\uc5c5\uc740\ud589', '\uae30\uc5c5\uc740\ud589'), ('\uad6d\ubbfc\uc740\ud589', '\uad6d\ubbfc\uc740\ud589'), ('\uc678\ud658\uc740\ud589', '\uc678\ud658\uc740\ud589'), ('\uc218\ud611\uc911\uc559\ud68c', '\uc218\ud611\uc911\uc559\ud68c'), ('\ub18d\ud611\uc911\uc559\ud68c', '\ub18d\ud611\uc911\uc559\ud68c'), ('\uc6b0\ub9ac\uc740\ud589', '\uc6b0\ub9ac\uc740\ud589'), ('SC\uc81c\uc77c\uc740\ud589', 'SC\uc81c\uc77c\uc740\ud589'), ('\ub300\uad6c\uc740\ud589', '\ub300\uad6c\uc740\ud589'), ('\ubd80\uc0b0\uc740\ud589', '\ubd80\uc0b0\uc740\ud589'), ('\uad11\uc8fc\uc740\ud589', '\uad11\uc8fc\uc740\ud589'), ('\uc804\ubd81\uc740\ud589', '\uc804\ubd81\uc740\ud589'), ('\uacbd\ub0a8\uc740\ud589', '\uacbd\ub0a8\uc740\ud589'), ('\ud55c\uad6d\uc528\ud2f0\uc740\ud589', '\ud55c\uad6d\uc528\ud2f0\uc740\ud589'), ('\uc6b0\uccb4\uad6d', '\uc6b0\uccb4\uad6d'), ('\ud558\ub098\uc740\ud589', '\ud558\ub098\uc740\ud589'), ('\ud1b5\ud569\uc2e0\ud55c\uc740\ud589(\uc2e0\ud55c,\uc870\ud765\uc740\ud589)', '\ud1b5\ud569\uc2e0\ud55c\uc740\ud589(\uc2e0\ud55c,\uc870\ud765\uc740\ud589)'), ('\uc720\uc548\ud0c0\uc99d\uad8c(\uad6c \ub3d9\uc591\uc99d\uad8c)', '\uc720\uc548\ud0c0\uc99d\uad8c(\uad6c \ub3d9\uc591\uc99d\uad8c)'), ('\ud604\ub300\uc99d\uad8c', '\ud604\ub300\uc99d\uad8c'), ('\ubbf8\ub798\uc5d0\uc14b\uc99d\uad8c', '\ubbf8\ub798\uc5d0\uc14b\uc99d\uad8c'), ('\ud55c\uad6d\ud22c\uc790\uc99d\uad8c', '\ud55c\uad6d\ud22c\uc790\uc99d\uad8c'), ('\uc6b0\ub9ac\ud22c\uc790\uc99d\uad8c', '\uc6b0\ub9ac\ud22c\uc790\uc99d\uad8c'), ('\ud558\uc774\ud22c\uc790\uc99d\uad8c', '\ud558\uc774\ud22c\uc790\uc99d\uad8c'), ('HMC\ud22c\uc790\uc99d\uad8c', 'HMC\ud22c\uc790\uc99d\uad8c'), ('SK\uc99d\uad8c', 'SK\uc99d\uad8c'), ('\ub300\uc2e0\uc99d\uad8c', '\ub300\uc2e0\uc99d\uad8c'), ('\ud558\ub098\ub300\ud22c\uc99d\uad8c', '\ud558\ub098\ub300\ud22c\uc99d\uad8c'), ('\uad7f\ubaa8\ub2dd\uc2e0\ud55c\uc99d\uad8c', '\uad7f\ubaa8\ub2dd\uc2e0\ud55c\uc99d\uad8c'), ('\ub3d9\ubd80\uc99d\uad8c', '\ub3d9\ubd80\uc99d\uad8c'), ('\uc720\uc9c4\ud22c\uc790\uc99d\uad8c', '\uc720\uc9c4\ud22c\uc790\uc99d\uad8c'), ('\uba54\ub9ac\uce20\uc99d\uad8c', '\uba54\ub9ac\uce20\uc99d\uad8c'), ('\uc2e0\uc601\uc99d\uad8c', '\uc2e0\uc601\uc99d\uad8c'), ('\ud55c\uad6d\uc528\ud2f0\uc740\ud589(\ud55c\ubbf8\uc740\ud589)', '\ud55c\uad6d\uc528\ud2f0\uc740\ud589 (\ud55c\ubbf8\uc740\ud589)')], default='', max_length=120, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('seller', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounts.Seller')),
            ],
        ),
        migrations.CreateModel(
            name='Withdrawal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('money', models.PositiveIntegerField(default=0)),
                ('status', models.CharField(choices=[('request', '\ucd9c\uae08\uc694\uccad'), ('completed', '\ucd9c\uae08\uc644\ub8cc'), ('rejected', '\ucd9c\uae08\uac70\uc808')], max_length=15, null=True)),
                ('reject_reason', models.CharField(blank=True, max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('timestamp', models.DateTimeField(auto_now=True)),
                ('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.Seller')),
            ],
        ),
    ]
コード例 #27
0
class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('accounts', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Call',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('funds', models.PositiveIntegerField()),
                ('target',
                 models.CharField(choices=[
                     ('A',
                      'Priority Area A: Future Networks & Communications'),
                     ('B',
                      'Priority Area B: Data Analytics, Management, Security & Privacy'
                      ),
                     ('C',
                      'Priority Area C: Digital Platforms, Content & Applications'
                      ),
                     ('D',
                      'Priority Area D: Connected Health & Indepentant Living'
                      ), ('E', 'Priority Area E: Medical Devices'),
                     ('F', 'Priority Area F: Diagnostics'),
                     ('G',
                      'Priority Area G: Therapeutics: Synthesis, Formulation, Processing & Drug Delivery'
                      ), ('H', 'Priority Area H: Food for Health'),
                     ('I',
                      'Priority Area I: Sustainable Food Producation & Processing'
                      ), ('J', 'Priority Area J: Marine Renewable Energy'),
                     ('K', 'Priority Area K: Smart Grids & Smart Cities'),
                     ('L', 'Priority Area L: Manufacturing Competiveness'),
                     ('M',
                      'Priority Area M: Processing Technologies & Novel Matierials'
                      ),
                     ('N',
                      'Priority Area N: Innovation in Services & Business Processes'
                      ), ('S', 'Software'), ('O', 'Other')
                 ],
                                  max_length=1,
                                  verbose_name='Target audience')),
                ('criteria',
                 models.TextField(verbose_name='Eligibility Criteria')),
                ('template', models.FileField(upload_to='call_templates/%Y/')),
                ('created', models.DateField(auto_now_add=True)),
                ('duration',
                 models.CharField(max_length=100,
                                  verbose_name='Duration of the award')),
                ('early_start',
                 models.DateField(
                     verbose_name='Earliest expected start date')),
                ('late_start',
                 models.DateField(verbose_name='Latest expected start date')),
                ('deadline', models.DateField()),
            ],
            options={
                'db_table': 'calls',
            },
        ),
        migrations.CreateModel(
            name='Center',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('info',
                 models.TextField(verbose_name='Additional information')),
                ('created', models.DateField(auto_now_add=True)),
            ],
            options={
                'db_table': 'centers',
            },
        ),
        migrations.CreateModel(
            name='Funder',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('organisation', models.CharField(max_length=100)),
            ],
            options={
                'db_table': 'funders',
            },
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('delivery_date',
                 models.DateField(verbose_name='Expected date of completion')),
                ('budget',
                 models.PositiveIntegerField(verbose_name='Project budget')),
                ('title', models.CharField(max_length=100)),
                ('information',
                 models.TextField(verbose_name='Additional information')),
                ('center',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='accounts.Center')),
            ],
        ),
        migrations.CreateModel(
            name='Proposal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('details',
                 models.TextField(verbose_name='Details of proposal')),
                ('proposal_document',
                 models.FileField(
                     upload_to=accounts.models.get_proposal_filename)),
                ('status',
                 models.CharField(choices=[('p', 'Pending'), ('r', 'Reviewed'),
                                           ('a', 'Accepted'), ('d', 'Denied')],
                                  max_length=1)),
                ('date', models.DateField(auto_now_add=True)),
            ],
            options={
                'db_table': 'proposals',
            },
        ),
        migrations.CreateModel(
            name='Researcher',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('job_title', models.CharField(max_length=100)),
                ('prefix',
                 models.CharField(choices=[('mr', 'Mr'), ('rs', 'Mrs'),
                                           ('ms', 'Ms'), ('mx', 'Mx'),
                                           ('dr', 'Dr'), ('pr', 'Prof')],
                                  max_length=2)),
                ('suffix', models.CharField(blank=True, max_length=10)),
                ('phone',
                 models.CharField(blank=True,
                                  max_length=15,
                                  verbose_name='Phone number')),
                ('orcid',
                 models.CharField(blank=True,
                                  max_length=19,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          regex='^(?:(?:\\d){4}-?){4}$')
                                  ],
                                  verbose_name='ORCID number')),
                ('profile_picture',
                 models.ImageField(blank=True,
                                   height_field=180,
                                   null=True,
                                   upload_to='profile_pics',
                                   width_field=180)),
            ],
            options={
                'db_table': 'researchers',
            },
        ),
        migrations.CreateModel(
            name='Reviewer',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('field',
                 models.CharField(choices=[
                     ('A',
                      'Priority Area A: Future Networks & Communications'),
                     ('B',
                      'Priority Area B: Data Analytics, Management, Security & Privacy'
                      ),
                     ('C',
                      'Priority Area C: Digital Platforms, Content & Applications'
                      ),
                     ('D',
                      'Priority Area D: Connected Health & Indepentant Living'
                      ), ('E', 'Priority Area E: Medical Devices'),
                     ('F', 'Priority Area F: Diagnostics'),
                     ('G',
                      'Priority Area G: Therapeutics: Synthesis, Formulation, Processing & Drug Delivery'
                      ), ('H', 'Priority Area H: Food for Health'),
                     ('I',
                      'Priority Area I: Sustainable Food Producation & Processing'
                      ), ('J', 'Priority Area J: Marine Renewable Energy'),
                     ('K', 'Priority Area K: Smart Grids & Smart Cities'),
                     ('L', 'Priority Area L: Manufacturing Competiveness'),
                     ('M',
                      'Priority Area M: Processing Technologies & Novel Matierials'
                      ),
                     ('N',
                      'Priority Area N: Innovation in Services & Business Processes'
                      ), ('S', 'Software'), ('O', 'Other')
                 ],
                                  max_length=1)),
            ],
            options={
                'db_table': 'reviewers',
            },
        ),
        migrations.RemoveField(
            model_name='userprofile',
            name='user',
        ),
        migrations.DeleteModel(name='UserProfile', ),
        migrations.AddField(
            model_name='proposal',
            name='call',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='proposal_call',
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='proposal',
            name='reviewer',
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='accounts.Reviewer'),
        ),
        migrations.AddField(
            model_name='proposal',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='project',
            name='researcher',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='center',
            name='admin',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='center',
            name='members',
            field=models.ManyToManyField(db_table='center_researcher',
                                         related_name='center_in_center',
                                         to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='call',
            name='funder',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='accounts.Funder'),
        ),
    ]
コード例 #28
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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')),
                ('email',
                 models.EmailField(
                     help_text='snu.ac.kr 계정 메일을 입력해주세요',
                     max_length=254,
                     unique=True,
                     validators=[accounts.validators.snumail_validator],
                     verbose_name='이메일')),
                ('name', models.CharField(max_length=30, verbose_name='이름')),
                ('phone',
                 models.CharField(
                     help_text='01x-xxxx-xxxx 형식으로 적어주세요',
                     max_length=20,
                     validators=[accounts.validators.phone_validator],
                     verbose_name='휴대폰번호')),
                ('student_no',
                 models.CharField(
                     help_text='20xx-xxxxx 형식으로 적어주세요',
                     max_length=12,
                     unique=True,
                     validators=[accounts.validators.student_no_validator],
                     verbose_name='학번')),
                ('college',
                 models.CharField(choices=[('hum', '인문대학'), ('soc', '사회과학대학'),
                                           ('nat', '자연과학대학'), ('nur', '간호대학'),
                                           ('mba', '경영대학'), ('eng', '공과대학'),
                                           ('agr', '농업생명과학대학'),
                                           ('art', '미술대학'), ('law', '법과대학'),
                                           ('edu', '사범대학'), ('che', '생활과학대학'),
                                           ('vet', '수의과대학'), ('pha', '약학대학'),
                                           ('mus', '음악대학'), ('med', '의과대학'),
                                           ('cls', '자유전공학부'), ('uni', '연합전공'),
                                           ('cor', '연계전공')],
                                  max_length=3,
                                  verbose_name='단과대학')),
                ('department',
                 models.CharField(choices=[
                     ('aa', '국어국문학과'), ('bb', '중어중문학과'), ('cc', '영어영문학과'),
                     ('dd', '독어독문학과'), ('ee', '노어노문학과'), ('ff', '서어서문학과'),
                     ('gg', '아시아언어문명학부'), ('hh', '불어불문학과'), ('ii', '언어학과'),
                     ('jj', '국사학과'), ('kk', '동양사학과'), ('ll', '서양사학과'),
                     ('mm', '철학과'), ('nn', '종교학과'), ('oo', '미학과'),
                     ('pp', '고고미술사학과'), ('qq', '정치외교학부'), ('rr', '경제학부'),
                     ('ss', '사회학과'), ('tt', '인류학과'), ('uu', '심리학과'),
                     ('vv', '지리학과'), ('ww', '사회복지학과'), ('xx', '언론정보학과'),
                     ('yy', '수리과학부'), ('zz', '통계학과'), ('ab', '물리천문학부'),
                     ('ac', '화학부'), ('ad', '생명과학부'), ('ae', '지구환경과학부'),
                     ('af', '간호학과'), ('ag', '경영학과'), ('ah', '건설환경공학부'),
                     ('ai', '기계항공공학부'), ('aj', '재료공학부'), ('ak', '전기정보공학부'),
                     ('al', '컴퓨터공학부'), ('am', '산업공학과'), ('an', '화학생물공학부'),
                     ('ao', '건축학과'), ('ap', '건축공학과'), ('aq', '조선해양공학과'),
                     ('ar', '에너지자원공학과'), ('as', '원자력공학과'), ('at', '식물생산과학부'),
                     ('au', '산림과학부'), ('av', '응용생물화학부'), ('aw', '식품동물생명공학부'),
                     ('ax', '바비오시스템소재학부'), ('ay', '조경지역시스템공학부'),
                     ('az', '농경제사회학부'), ('bc', '동양화과'), ('bd', '서양화과'),
                     ('be', '조소과'), ('bf', '공예과'), ('bg', '디자인과'),
                     ('lw', '법학부'), ('11', '교육학과'), ('22', '국어교육과'),
                     ('33', '영어교육과'), ('44', '불어교육과'), ('55', '독어교육과'),
                     ('66', '사회교육과'), ('77', '역사교육과'), ('88', '지리교육과'),
                     ('99', '윤리교육과'), ('00', '수학교육과'), ('1a', '물리교육과'),
                     ('1b', '화학교육과'), ('1c', '생물교육과'), ('1d', '지구과학교육과'),
                     ('1e', '체육교육과'), ('1f', '소비자아동학부'), ('1g', '식품영양학과'),
                     ('1h', '의류학과'), ('1i', '수의예과'), ('1j', '수의학과'),
                     ('1k', '약학과'), ('1l', '제약학과'), ('1m', '성악과'),
                     ('1n', '작곡과(이론)'), ('1o', '작곡과(작곡)'), ('1p', '기악과'),
                     ('1q', '국악과'), ('1r', '의예과'), ('1s', '의학과'),
                     ('1t', '자유전공학부'), ('2a', '계산과학'), ('2b', '글로벌환경경영학'),
                     ('2c', '기술경영'), ('2d', '영상매체예술'), ('2e', '정보문화학'),
                     ('2f', '벤처경영학'), ('2g', '동아시아비교인문학'), ('3a', '중국학'),
                     ('3b', '미국학'), ('3c', '러시아학'), ('3d', '라틴아메리카학'),
                     ('3e', '유럽지역학'), ('3f', '뇌마음행동'), ('3g', '금융경제'),
                     ('3h', '금융수학'), ('3i', '과학기술학'), ('3j', '공학바이오'),
                     ('3k', '통합창의디자인'), ('3l', '고전문헌학'), ('3m', '인문데이터과학'),
                     ('3n', '정치경제철학')
                 ],
                                  max_length=2,
                                  verbose_name='학과')),
                ('student_category',
                 models.CharField(choices=[('u', '학부'), ('g', '대학원'),
                                           ('i', '교환학생')],
                                  max_length=1,
                                  verbose_name='분류')),
                ('enroll_year',
                 models.IntegerField(
                     default=2018,
                     validators=[accounts.validators.enroll_year_validator],
                     verbose_name='가입년도')),
                ('enroll_semester',
                 models.PositiveIntegerField(choices=[(1, '1학기'), (2, '2학기')],
                                             default=1,
                                             verbose_name='가입학기')),
                ('profile_pic',
                 imagekit.models.fields.ProcessedImageField(
                     blank=True, upload_to=accounts.models.get_profile_path)),
                ('rule_confirm',
                 models.BooleanField(default=False, verbose_name='약관동의')),
                ('date_joined',
                 models.DateTimeField(auto_now_add=True, verbose_name='가입일')),
                ('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='활동상태')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='운영진 여부')),
                ('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': '회원',
                'verbose_name_plural': '회원',
            },
            managers=[
                ('objects', accounts.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='ActiveUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('active_year',
                 models.PositiveIntegerField(default=2018,
                                             verbose_name='활동년도')),
                ('active_semester',
                 models.PositiveIntegerField(choices=[(1, '1학기'), (2, '2학기')],
                                             verbose_name='활동학기')),
                ('is_new',
                 models.BooleanField(default=False, verbose_name='신입회원여부')),
                ('is_paid',
                 models.BooleanField(default=False, verbose_name='입금확인')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': '활동 회원',
                'verbose_name_plural': '활동 회원',
            },
        ),
        migrations.AlterUniqueTogether(
            name='activeuser',
            unique_together={('user', 'active_year', 'active_semester')},
        ),
    ]
コード例 #29
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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')),
                ('image',
                 models.ImageField(
                     blank=True,
                     height_field='height_field',
                     null=True,
                     upload_to=accounts.models.users_upload_location,
                     width_field='width_field')),
                ('width_field',
                 models.PositiveIntegerField(blank=True, default=0,
                                             null=True)),
                ('height_field',
                 models.PositiveIntegerField(blank=True, default=0,
                                             null=True)),
                ('gender',
                 models.CharField(choices=[('female', 'Kadın'),
                                           ('male', 'Erkek')],
                                  max_length=10,
                                  verbose_name='Cinsiyet')),
                ('username',
                 models.CharField(
                     error_messages={'unique': 'Bu kullanıcı adı mevcut'},
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name='E-posta')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='İsim')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=50,
                                  verbose_name='Soyisim')),
                ('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')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('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',
            },
        ),
    ]
コード例 #30
0
ファイル: 0001_initial.py プロジェクト: boiyelove/wallions
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('imgpost', '0009_auto_20170113_1505'),
    ]

    operations = [
        migrations.CreateModel(
            name='EmailVerification',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('published_on', models.DateTimeField(blank=True, null=True)),
                ('email',
                 models.EmailField(default='*****@*****.**',
                                   max_length=254,
                                   unique=True)),
                ('slug', models.SlugField(null=True)),
                ('confirmed', models.BooleanField(default=False)),
                ('action', models.URLField()),
                ('actiontype', models.CharField(default='USER',
                                                max_length=10)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FavouriteItems',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('posts', models.ManyToManyField(to='imgpost.ImgPost')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Following',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
                ('users',
                 models.ManyToManyField(related_name='followed_by',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('published_on', models.DateTimeField(blank=True, null=True)),
                ('headshot',
                 models.ImageField(
                     upload_to=accounts.models.user_directory_path)),
                ('verified', models.BooleanField(default=False)),
                ('lastpasswordreset', models.DateTimeField(null=True)),
                ('name', models.CharField(max_length=160)),
                ('bio', models.TextField()),
                ('head_shot', models.ImageField(upload_to='user_profile')),
                ('profile_bg', models.ImageField(upload_to='user_profile')),
                ('website', models.URLField()),
                ('views', models.PositiveIntegerField(default=0)),
                ('referral',
                 models.ForeignKey(editable=False,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='parent',
                                   to=settings.AUTH_USER_MODEL)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]