class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to='banner/', verbose_name='轮播图片')),
                ('index',
                 models.SmallIntegerField(default=0, verbose_name='轮播顺序')),
                ('add_time',
                 models.DateField(default=datetime.datetime.now,
                                  help_text='添加时间',
                                  verbose_name='添加时间')),
                ('status',
                 models.NullBooleanField(default=True,
                                         help_text='数据状态',
                                         verbose_name='数据状态')),
            ],
            options={
                'verbose_name': '轮播的商品',
                'verbose_name_plural': '轮播的商品',
            },
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('goods_sn',
                 models.CharField(default='',
                                  max_length=50,
                                  verbose_name='商品唯一货号')),
                ('name', models.CharField(max_length=240, verbose_name='商品名')),
                ('click_num', models.IntegerField(default=0,
                                                  verbose_name='点击数')),
                ('sold_num', models.IntegerField(default=0,
                                                 verbose_name='销售量')),
                ('fav_num', models.IntegerField(default=0,
                                                verbose_name='收藏数')),
                ('goods_num', models.IntegerField(default=0,
                                                  verbose_name='库存数')),
                ('market_price',
                 models.FloatField(default=0, verbose_name='市场价格')),
                ('shop_price', models.FloatField(default=0,
                                                 verbose_name='本店价格')),
                ('goods_brief',
                 models.TextField(max_length=300, verbose_name='商品简短描述')),
                ('goods_desc',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='内容')),
                ('ship_free',
                 models.BooleanField(default=True, verbose_name='是否免邮')),
                ('goods_front_image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='goods/front',
                                   verbose_name='代表性图片')),
                ('is_new',
                 models.BooleanField(default=False, verbose_name='是否新品')),
                ('is_hot',
                 models.BooleanField(default=False, verbose_name='是否热销')),
                ('add_time',
                 models.DateField(default=datetime.datetime.now,
                                  help_text='添加时间',
                                  verbose_name='添加时间')),
                ('status',
                 models.NullBooleanField(default=True,
                                         help_text='数据状态',
                                         verbose_name='数据状态')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(default='',
                                  help_text='类别名',
                                  max_length=30,
                                  verbose_name='类别名')),
                ('code',
                 models.CharField(default='',
                                  help_text='类别code',
                                  max_length=30,
                                  verbose_name='类别code')),
                ('desc',
                 models.CharField(default='',
                                  help_text='类别描述',
                                  max_length=120,
                                  verbose_name='类别描述')),
                ('category_type',
                 models.IntegerField(choices=[(1, '一级类目'), (2, '二级类目'),
                                              (3, '三级类目')],
                                     help_text='类别描述')),
                ('is_tab',
                 models.BooleanField(default=False,
                                     help_text='是否热门',
                                     verbose_name='是否热门')),
                ('add_time',
                 models.DateField(default=datetime.datetime.now,
                                  help_text='添加时间',
                                  verbose_name='添加时间')),
                ('status',
                 models.NullBooleanField(default=True,
                                         help_text='数据状态',
                                         verbose_name='数据状态')),
                ('parent_category',
                 models.ForeignKey(blank=True,
                                   help_text='父类别',
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sub_cat',
                                   to='goods.GoodsCategory',
                                   verbose_name='父类别')),
            ],
            options={
                'verbose_name': '商品类别',
                'verbose_name_plural': '商品类别',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategoryBrand',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(default='',
                                  help_text='类别名',
                                  max_length=30,
                                  verbose_name='类别名')),
                ('desc',
                 models.TextField(default='',
                                  help_text='类别描述',
                                  verbose_name='类别描述')),
                ('image',
                 models.ImageField(max_length=200,
                                   upload_to='brand/images/',
                                   verbose_name='图片')),
                ('add_time',
                 models.DateField(default=datetime.datetime.now,
                                  help_text='添加时间',
                                  verbose_name='添加时间')),
                ('status',
                 models.NullBooleanField(default=True,
                                         help_text='数据状态',
                                         verbose_name='数据状态')),
            ],
            options={
                'verbose_name': '品牌',
                'verbose_name_plural': '品牌',
            },
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='goods/images/',
                                   verbose_name='图片')),
                ('image_url',
                 models.CharField(blank=True,
                                  max_length=300,
                                  null=True,
                                  verbose_name='图片url')),
                ('add_time',
                 models.DateField(default=datetime.datetime.now,
                                  help_text='添加时间',
                                  verbose_name='添加时间')),
                ('status',
                 models.NullBooleanField(default=True,
                                         help_text='数据状态',
                                         verbose_name='数据状态')),
                ('goods',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='images',
                                   to='goods.Goods',
                                   verbose_name='商品')),
            ],
            options={
                'verbose_name': '商品的图片',
                'verbose_name_plural': '商品的图片',
            },
        ),
        migrations.AddField(
            model_name='goods',
            name='category',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.GoodsCategory',
                verbose_name='商品类目'),
        ),
        migrations.AddField(
            model_name='banner',
            name='goods',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.Goods',
                verbose_name='商品'),
        ),
    ]
Beispiel #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='课程名')),
                ('desc', models.TextField(verbose_name='课程描述')),
                ('level',
                 models.CharField(choices=[('primary', '初级'), ('middle', '中级'),
                                           ('advanced', '高级')],
                                  default='primary',
                                  max_length=20)),
                ('detail',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='课程详情')),
                ('learn_times',
                 models.IntegerField(default=0, verbose_name='学习时长(分钟数)')),
                ('cover',
                 models.ImageField(default='course/cover/default.png',
                                   upload_to='course/cover/%Y/%m',
                                   verbose_name='课程封面')),
                ('tag',
                 models.CharField(default='',
                                  max_length=20,
                                  verbose_name='课程标签')),
                ('tips',
                 models.CharField(default='',
                                  max_length=300,
                                  verbose_name='课程须知')),
                ('tell_you',
                 models.CharField(default='',
                                  max_length=300,
                                  verbose_name='老师告诉你')),
                ('is_banner',
                 models.BooleanField(default=False, verbose_name='是否轮播')),
                ('click_nums',
                 models.IntegerField(default=0, verbose_name='点击量')),
                ('stu_nums', models.IntegerField(default=0,
                                                 verbose_name='学习人数')),
                ('fav_nums', models.IntegerField(default=0,
                                                 verbose_name='收藏人数')),
                ('add_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '课程',
                'verbose_name_plural': '课程',
            },
        ),
        migrations.CreateModel(
            name='CourseCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='课程类别')),
                ('index',
                 models.SmallIntegerField(default=100, verbose_name='类别排序')),
            ],
            options={
                'verbose_name': '课程类别',
                'verbose_name_plural': '课程类别',
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='章节名')),
                ('add_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course',
                                   verbose_name='所属课程')),
            ],
            options={
                'verbose_name': '章节',
                'verbose_name_plural': '章节',
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='资源名称')),
                ('download',
                 models.FileField(upload_to='course/resource/%Y/%m',
                                  verbose_name='资源文件')),
                ('add_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Course',
                                   verbose_name='所属课程')),
            ],
            options={
                'verbose_name': '课程资源',
                'verbose_name_plural': '课程资源',
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='视频名称')),
                ('url',
                 models.URLField(default='', unique=True,
                                 verbose_name='访问地址')),
                ('add_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('lesson',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='course.Lesson',
                                   verbose_name='所属章节')),
            ],
            options={
                'verbose_name': '视频',
                'verbose_name_plural': '视频',
            },
        ),
        migrations.AddField(
            model_name='course',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='course.CourseCategory',
                verbose_name='课程类别'),
        ),
        migrations.AddField(
            model_name='course',
            name='org',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='org.Org',
                verbose_name='所属机构'),
        ),
        migrations.AddField(
            model_name='course',
            name='teacher',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='org.Teacher',
                verbose_name='所属教师'),
        ),
    ]
Beispiel #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CurrentSignalPack',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Collected Time')),
                ('sampling_rate', models.IntegerField(blank=True, null=True)),
                ('rpm',
                 models.SmallIntegerField(default=3000, verbose_name='RPM')),
            ],
        ),
        migrations.CreateModel(
            name='Manufacturer',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=64,
                                  unique=True,
                                  verbose_name='Manufacturer name')),
                ('telephone',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='Telephone')),
                ('memo',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='Memory')),
            ],
        ),
        migrations.CreateModel(
            name='MonthlyRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('c_day',
                 models.DateField(auto_now_add=True,
                                  verbose_name='Created time')),
                ('description',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Content')),
            ],
        ),
        migrations.CreateModel(
            name='Motor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=64,
                                  unique=True,
                                  verbose_name='Name of asset')),
                ('sn',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Serial number')),
                ('statu',
                 models.SmallIntegerField(choices=[
                     (0, 'Excellent'), (1, 'Good'), (2, 'Moderate'),
                     (3, 'Poor'), (4, 'Offline')
                 ],
                                          default=2,
                                          verbose_name='Asset statu')),
                ('health_indicator',
                 models.FloatField(default=85,
                                   verbose_name='Value of Health Indicator')),
                ('lr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Last repair/check date')),
                ('pr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Purchase date')),
                ('md_time',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Modified date')),
                ('cr_time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('sr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Start running date')),
                ('phase_number',
                 models.SmallIntegerField(blank=True,
                                          null=True,
                                          verbose_name='Number of phases ')),
                ('pole_pairs_number',
                 models.SmallIntegerField(
                     blank=True,
                     null=True,
                     verbose_name='Number of pole_pairs ')),
                ('turn_number',
                 models.SmallIntegerField(blank=True,
                                          null=True,
                                          verbose_name='Number of turns ')),
                ('rated_voltage',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Rated voltage /V')),
                ('rated_speed',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Rated speed /rpm')),
                ('memo',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Memory')),
                ('equip_type',
                 models.SmallIntegerField(choices=[
                     (0, 'Motor'), (1, 'Bearing'), (2, 'Rotor'), (3, 'Stator')
                 ],
                                          default=0,
                                          verbose_name='Equipment type')),
                ('admin',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Administrator')),
                ('manufacturer',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='motors.Manufacturer',
                     verbose_name='Manufacturer')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=32,
                                  unique=True,
                                  verbose_name='Tag name')),
                ('c_day',
                 models.DateField(auto_now_add=True,
                                  verbose_name='Created time')),
            ],
        ),
        migrations.CreateModel(
            name='WeeklyRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('c_day',
                 models.DateField(auto_now_add=True,
                                  verbose_name='Created time')),
                ('description',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Content')),
            ],
        ),
        migrations.CreateModel(
            name='Wphase',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('signal',
                 models.BinaryField(verbose_name='Collected Signal vector')),
                ('frequency', models.FloatField(default=0,
                                                verbose_name='PSF')),
                ('amplitude', models.FloatField(default=0,
                                                verbose_name='AMP')),
                ('initial_phase',
                 models.FloatField(default=0, verbose_name='IPA')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='wphase',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Wfeature',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rms',
                 models.FloatField(default=0,
                                   verbose_name='U phase root-mean-square')),
                ('thd',
                 models.FloatField(
                     default=0, verbose_name='Total harmonic distortion %')),
                ('harmonics',
                 models.BinaryField(verbose_name='1st-20th harmonic energy')),
                ('max_current',
                 models.FloatField(default=0,
                                   verbose_name='Maximum current value')),
                ('min_current',
                 models.FloatField(default=0,
                                   verbose_name='Minimum current value')),
                ('fbrb',
                 models.BinaryField(
                     null=True,
                     verbose_name='Frequencies of Broken rotor bar')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='wfeature',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WarningLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('c_day',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created time')),
                ('description',
                 models.TextField(verbose_name='Warning description')),
                ('severity',
                 models.SmallIntegerField(blank=True,
                                          choices=[(0, 'Attention'),
                                                   (1, 'Serious')],
                                          null=True,
                                          verbose_name='Warning severity')),
                ('motor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='motors.Motor',
                                   verbose_name='Related motor')),
            ],
        ),
        migrations.CreateModel(
            name='Vphase',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('signal',
                 models.BinaryField(verbose_name='Collected Signal vector')),
                ('frequency', models.FloatField(default=0,
                                                verbose_name='PSF')),
                ('amplitude', models.FloatField(default=0,
                                                verbose_name='AMP')),
                ('initial_phase',
                 models.FloatField(default=0, verbose_name='IPA')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='vphase',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Vfeature',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rms',
                 models.FloatField(default=0,
                                   verbose_name='U phase root-mean-square')),
                ('thd',
                 models.FloatField(
                     default=0, verbose_name='Total harmonic distortion %')),
                ('harmonics',
                 models.BinaryField(verbose_name='1st-20th harmonic energy')),
                ('max_current',
                 models.FloatField(default=0,
                                   verbose_name='Maximum current value')),
                ('min_current',
                 models.FloatField(default=0,
                                   verbose_name='Minimum current value')),
                ('fbrb',
                 models.BinaryField(
                     null=True,
                     verbose_name='Frequencies of Broken rotor bar')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='vfeature',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Uphase',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('signal',
                 models.BinaryField(verbose_name='Collected Signal vector')),
                ('frequency', models.FloatField(default=0,
                                                verbose_name='PSF')),
                ('amplitude', models.FloatField(default=0,
                                                verbose_name='AMP')),
                ('initial_phase',
                 models.FloatField(default=0, verbose_name='IPA')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='uphase',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Ufeature',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rms',
                 models.FloatField(default=0,
                                   verbose_name='U phase root-mean-square')),
                ('thd',
                 models.FloatField(
                     default=0, verbose_name='Total harmonic distortion %')),
                ('harmonics',
                 models.BinaryField(verbose_name='1st-20th harmonic energy')),
                ('max_current',
                 models.FloatField(default=0,
                                   verbose_name='Maximum current value')),
                ('min_current',
                 models.FloatField(default=0,
                                   verbose_name='Minimum current value')),
                ('fbrb',
                 models.BinaryField(
                     null=True,
                     verbose_name='Frequencies of Broken rotor bar')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='ufeature',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SymComponent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('n_sequence_rms',
                 models.FloatField(
                     default=0,
                     verbose_name='Negative sequence root-mean-square')),
                ('p_sequence_rms',
                 models.FloatField(
                     default=0,
                     verbose_name='Positive sequence root-mean-square')),
                ('z_sequence_rms',
                 models.FloatField(
                     default=0,
                     verbose_name='Zero sequence root-mean-square')),
                ('imbalance',
                 models.FloatField(default=0,
                                   verbose_name='Current imbanlance %')),
                ('signal_pack',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='symcomp',
                     to='motors.CurrentSignalPack',
                     verbose_name='Parent pack')),
            ],
        ),
        migrations.CreateModel(
            name='Stator',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=64,
                                  unique=True,
                                  verbose_name='Name of asset')),
                ('sn',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Serial number')),
                ('statu',
                 models.SmallIntegerField(choices=[
                     (0, 'Excellent'), (1, 'Good'), (2, 'Moderate'),
                     (3, 'Poor'), (4, 'Offline')
                 ],
                                          default=2,
                                          verbose_name='Asset statu')),
                ('health_indicator',
                 models.FloatField(default=85,
                                   verbose_name='Value of Health Indicator')),
                ('lr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Last repair/check date')),
                ('pr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Purchase date')),
                ('md_time',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Modified date')),
                ('cr_time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('sr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Start running date')),
                ('length',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Length /mm')),
                ('outer_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Outer diameter /mm')),
                ('inner_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Inner diameter /mm')),
                ('slot_number',
                 models.SmallIntegerField(blank=True,
                                          null=True,
                                          verbose_name='Number of slots')),
                ('memo',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Memory')),
                ('equip_type',
                 models.SmallIntegerField(choices=[
                     (0, 'Motor'), (1, 'Bearing'), (2, 'Rotor'), (3, 'Stator')
                 ],
                                          default=3,
                                          verbose_name='Equipment type')),
                ('manufacturer',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='motors.Manufacturer',
                     verbose_name='Manufacturer')),
                ('motor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='stators',
                                   to='motors.Motor')),
                ('tags',
                 models.ManyToManyField(blank=True,
                                        to='motors.Tag',
                                        verbose_name='Tags')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Rotor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=64,
                                  unique=True,
                                  verbose_name='Name of asset')),
                ('sn',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Serial number')),
                ('statu',
                 models.SmallIntegerField(choices=[
                     (0, 'Excellent'), (1, 'Good'), (2, 'Moderate'),
                     (3, 'Poor'), (4, 'Offline')
                 ],
                                          default=2,
                                          verbose_name='Asset statu')),
                ('health_indicator',
                 models.FloatField(default=85,
                                   verbose_name='Value of Health Indicator')),
                ('lr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Last repair/check date')),
                ('pr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Purchase date')),
                ('md_time',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Modified date')),
                ('cr_time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('sr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Start running date')),
                ('length',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Length /mm')),
                ('outer_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Outer diameter /mm')),
                ('inner_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Inner diameter /mm')),
                ('slot_number',
                 models.SmallIntegerField(blank=True,
                                          null=True,
                                          verbose_name='Number of slots')),
                ('memo',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Memory')),
                ('equip_type',
                 models.SmallIntegerField(choices=[
                     (0, 'Motor'), (1, 'Bearing'), (2, 'Rotor'), (3, 'Stator')
                 ],
                                          default=2,
                                          verbose_name='Equipment type')),
                ('manufacturer',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='motors.Manufacturer',
                     verbose_name='Manufacturer')),
                ('motor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='rotors',
                                   to='motors.Motor')),
                ('tags',
                 models.ManyToManyField(blank=True,
                                        to='motors.Tag',
                                        verbose_name='Tags')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='motor',
            name='tags',
            field=models.ManyToManyField(blank=True,
                                         to='motors.Tag',
                                         verbose_name='Tags'),
        ),
        migrations.AddField(
            model_name='currentsignalpack',
            name='motor',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='packs',
                to='motors.Motor'),
        ),
        migrations.CreateModel(
            name='Bearing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=64,
                                  unique=True,
                                  verbose_name='Name of asset')),
                ('sn',
                 models.CharField(max_length=128,
                                  unique=True,
                                  verbose_name='Serial number')),
                ('statu',
                 models.SmallIntegerField(choices=[
                     (0, 'Excellent'), (1, 'Good'), (2, 'Moderate'),
                     (3, 'Poor'), (4, 'Offline')
                 ],
                                          default=2,
                                          verbose_name='Asset statu')),
                ('health_indicator',
                 models.FloatField(default=85,
                                   verbose_name='Value of Health Indicator')),
                ('lr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Last repair/check date')),
                ('pr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Purchase date')),
                ('md_time',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Modified date')),
                ('cr_time',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Created date')),
                ('sr_time',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='Start running date')),
                ('inner_race_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Inner race diameter /mm')),
                ('inner_race_width',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Inner race width /mm')),
                ('outter_race_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Outter race diameter /mm')),
                ('outter_race_width',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Outter race width /mm')),
                ('equip_type',
                 models.SmallIntegerField(choices=[
                     (0, 'Motor'), (1, 'Bearing'), (2, 'Rotor'), (3, 'Stator')
                 ],
                                          default=1,
                                          verbose_name='Equipment type')),
                ('roller_diameter',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Roller diameter /mm')),
                ('roller_number',
                 models.SmallIntegerField(blank=True,
                                          null=True,
                                          verbose_name='Number of rollers')),
                ('contact_angle',
                 models.FloatField(blank=True,
                                   null=True,
                                   verbose_name='Contact angle ')),
                ('memo',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='Memory')),
                ('manufacturer',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='motors.Manufacturer',
                     verbose_name='Manufacturer')),
                ('motor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bearings',
                                   to='motors.Motor')),
                ('tags',
                 models.ManyToManyField(blank=True,
                                        to='motors.Tag',
                                        verbose_name='Tags')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Banner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('image', models.ImageField(upload_to='banner', verbose_name='轮播图片')),
                ('index', models.IntegerField(default=0, verbose_name='轮播顺序')),
            ],
            options={
                'verbose_name': '轮播商品',
                'verbose_name_plural': '轮播商品',
            },
        ),
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('goods_sn', models.CharField(default='', max_length=50, verbose_name='商品货号')),
                ('name', models.CharField(max_length=100, verbose_name='商品名称')),
                ('click_num', models.IntegerField(default=0, verbose_name='点击数')),
                ('sold_num', models.IntegerField(default=0, verbose_name='销售数量')),
                ('fav_num', models.IntegerField(default=0, verbose_name='收藏数量')),
                ('goods_num', models.IntegerField(default=0, verbose_name='库存数')),
                ('market_price', models.FloatField(default=0, verbose_name='市场价格')),
                ('shop_price', models.FloatField(default=0, verbose_name='本店价格')),
                ('goods_brief', models.TextField(max_length=500, verbose_name='商品简短描述')),
                ('goods_desc', DjangoUeditor.models.UEditorField(default='', verbose_name='内容')),
                ('ship_free', models.BooleanField(default=False, verbose_name='是否承担运费')),
                ('goods_front_image', models.ImageField(blank=True, null=True, upload_to='goods/images/', verbose_name='封面图')),
                ('is_new', models.BooleanField(default=False, verbose_name='是否新品')),
                ('is_hot', models.BooleanField(default=False, verbose_name='是否热销')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(default='', help_text='类别名', max_length=30, verbose_name='类别名')),
                ('code', models.CharField(default='', help_text='类别编码', max_length=30, verbose_name='类别编码')),
                ('desc', models.TextField(default='', help_text='类别描述', verbose_name='类别描述')),
                ('category_type', models.SmallIntegerField(choices=[(1, '一级类目'), (2, '二级类目'), (3, '三级类目')], help_text='类目级别', verbose_name='类目级别')),
                ('is_table', models.BooleanField(default=False, help_text='是否导航', verbose_name='是否导航')),
                ('parent_category', models.ForeignKey(blank=True, help_text='父目录级别', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sub_cat', to='goods.GoodsCategory', verbose_name='父目录级别')),
            ],
            options={
                'verbose_name': '商品类别',
                'verbose_name_plural': '商品类别',
            },
        ),
        migrations.CreateModel(
            name='GoodsCategoryBrand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('name', models.CharField(default='', help_text='品牌名', max_length=30, verbose_name='品牌名')),
                ('desc', models.CharField(default='', help_text='品牌描述', max_length=300, verbose_name='品牌描述')),
                ('image', models.ImageField(max_length=200, upload_to='brands/images')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='brands', to='goods.GoodsCategory', verbose_name='商品类目')),
            ],
            options={
                'verbose_name': '品牌名',
                'verbose_name_plural': '品牌名',
            },
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('image', models.ImageField(blank=True, null=True, upload_to='', verbose_name='图片')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='goods.Goods', verbose_name='商品')),
            ],
            options={
                'verbose_name': '商品图片',
                'verbose_name_plural': '商品图片',
            },
        ),
        migrations.CreateModel(
            name='HotSearchWords',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('keywords', models.CharField(default='', max_length=20, verbose_name='热搜词')),
                ('index', models.IntegerField(default=0, verbose_name='排序')),
            ],
            options={
                'verbose_name': '热搜词',
                'verbose_name_plural': '热搜词',
            },
        ),
        migrations.CreateModel(
            name='IndexAd',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='添加时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete', models.BooleanField(default=False, verbose_name='是否删除')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='category', to='goods.GoodsCategory', verbose_name='商品类目')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='goods', to='goods.Goods')),
            ],
            options={
                'verbose_name': '首页商品类别广告',
                'verbose_name_plural': '首页商品类别广告',
            },
        ),
        migrations.AddField(
            model_name='goods',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.GoodsCategory', verbose_name='商品类目'),
        ),
        migrations.AddField(
            model_name='banner',
            name='goods',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Goods', verbose_name='商品'),
        ),
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Store2User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('store_water_num', models.IntegerField(blank=True, null=True, verbose_name='流水编号')),
                ('store_source', models.IntegerField(blank=True, choices=[(0, '洗车'), (1, '活动'), (2, '提现'), (3, '核销')], null=True, verbose_name='来源')),
                ('store_money', models.PositiveIntegerField(blank=True, null=True, verbose_name='交易金额(单位分)')),
                ('user_water_num', models.IntegerField(blank=True, null=True, verbose_name='流水编号')),
                ('user_source', models.IntegerField(blank=True, choices=[(0, '洗车'), (1, '活动'), (2, '充值')], null=True, verbose_name='来源')),
                ('user_money', models.PositiveIntegerField(blank=True, null=True, verbose_name='交易金额(单位分)')),
            ],
            options={
                'verbose_name': '商家/用户钱包流水',
                'verbose_name_plural': '商家/用户钱包流水',
                'db_table': 'StoreWallet',
            },
        ),
        migrations.CreateModel(
            name='StoreManage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('linkman', models.CharField(blank=True, max_length=20, null=True, verbose_name='联系人姓名')),
                ('store_name', models.CharField(blank=True, max_length=20, null=True, verbose_name='店名')),
                ('store_add', models.CharField(max_length=100, verbose_name='店铺地址')),
                ('up_five_price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='5座以上价格')),
                ('low_five_price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='5座以下价格')),
                ('service', models.CharField(choices=[('标准洗车', 0), ('精致洗车', 1)], max_length=4, verbose_name='服务内容选择')),
                ('graded', models.CharField(blank=True, max_length=5, null=True, verbose_name='评分')),
                ('area', models.CharField(blank=True, max_length=20, null=True, verbose_name='区域')),
                ('location', models.CharField(blank=True, max_length=100, null=True, verbose_name='定位')),
                ('office_hours', models.TimeField(blank=True, null=True, verbose_name='上班时间')),
                ('closing_time', models.TimeField(blank=True, null=True, verbose_name='下班时间')),
                ('commission_rate', models.DecimalField(decimal_places=4, max_digits=5, verbose_name='佣金比例')),
                ('account', models.CharField(max_length=50, verbose_name='账号')),
                ('password', models.CharField(blank=True, max_length=20, null=True, verbose_name='密码')),
                ('bank_num', models.IntegerField(blank=True, null=True, verbose_name='银行卡号')),
                ('cardholder', models.CharField(blank=True, max_length=20, null=True, verbose_name='持卡人')),
                ('belong_bank', models.CharField(blank=True, max_length=100, null=True, verbose_name='所属银行')),
                ('service_content', models.TextField(blank=True, null=True, verbose_name='服务内容')),
                ('phone', models.CharField(blank=True, max_length=11, null=True, verbose_name='联系电话')),
                ('logo', models.ImageField(blank=True, null=True, upload_to='media/store/logo', verbose_name='店铺的logo')),
                ('store_img', models.ImageField(blank=True, null=True, upload_to='media/store', verbose_name='店铺图片')),
                ('detail', DjangoUeditor.models.UEditorField(default='', verbose_name='门店详情')),
                ('audit_status', models.IntegerField(choices=[(0, '通过审核'), (1, '未通过审核')], default='未通过审核', verbose_name='审核状态')),
                ('status', models.SmallIntegerField(choices=[(1, '空闲'), (2, '忙碌'), (3, '休息')], default=1, verbose_name='商家状态')),
                ('shop_lon', models.FloatField(blank=True, null=True, verbose_name='店铺经度')),
                ('shop_lat', models.FloatField(blank=True, null=True, verbose_name='店铺维度')),
                ('all_service_charge', models.PositiveIntegerField(blank=True, null=True, verbose_name='总手续费(单位分)')),
                ('balance', models.PositiveIntegerField(blank=True, null=True, verbose_name='余额(单位分)')),
                ('sub_store_manager', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='store.StoreManage', verbose_name='子账户')),
            ],
            options={
                'verbose_name': '门店',
                'verbose_name_plural': '门店',
                'db_table': 'store',
            },
        ),
    ]
Beispiel #6
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='商品名称')),
                ('desc', models.CharField(max_length=256,
                                          verbose_name='商品简介')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='商品价格')),
                ('unite', models.CharField(max_length=20,
                                           verbose_name='商品单位')),
                ('image',
                 models.ImageField(upload_to='goods', verbose_name='商品图片')),
                ('variety', models.CharField(max_length=20,
                                             verbose_name='品种')),
                ('manufacturing_season',
                 models.CharField(max_length=20, verbose_name='季节')),
                ('address', models.CharField(max_length=64,
                                             verbose_name='产地')),
                ('stock', models.IntegerField(default=1, verbose_name='商品库存')),
                ('sales', models.IntegerField(default=0, verbose_name='商品销量')),
                ('status',
                 models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')],
                                          default=1,
                                          verbose_name='商品状态')),
                ('detail',
                 DjangoUeditor.models.UEditorField(verbose_name='商品详情')),
            ],
            options={
                'verbose_name': '商品信息',
                'verbose_name_plural': '商品信息',
                'db_table': 'goods',
            },
        ),
        migrations.CreateModel(
            name='OrderGoods',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('count', models.IntegerField(default=1, verbose_name='商品数目')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='商品价格')),
                ('comment',
                 models.CharField(default='',
                                  max_length=256,
                                  verbose_name='评论')),
            ],
            options={
                'verbose_name': '订单商品',
                'verbose_name_plural': '订单商品',
                'db_table': 'df_order_goods',
            },
        ),
        migrations.CreateModel(
            name='OrderInfo',
            fields=[
                ('order_id',
                 models.CharField(max_length=128,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='订单id')),
                ('pay_method',
                 models.SmallIntegerField(choices=[(1, '货到付款'), (2, '微信支付'),
                                                   (3, '支付宝'), (4, '银联支付')],
                                          default=3,
                                          verbose_name='支付方式')),
                ('total_count',
                 models.IntegerField(default=1, verbose_name='商品数量')),
                ('total_price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='商品总价')),
                ('transit_price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='订单运费')),
                ('order_status',
                 models.SmallIntegerField(choices=[(1, '待支付'), (2, '待发货'),
                                                   (3, '待收货'), (4, '待评价'),
                                                   (5, '已完成')],
                                          default=1,
                                          verbose_name='订单状态')),
                ('trade_no',
                 models.CharField(default='',
                                  max_length=128,
                                  verbose_name='支付编号')),
            ],
            options={
                'verbose_name': '订单信息',
                'verbose_name_plural': '订单信息',
                'db_table': 'df_order_info',
            },
        ),
        migrations.CreateModel(
            name='UserAddress',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('receiver', models.CharField(max_length=20,
                                              verbose_name='收件人')),
                ('addr', models.CharField(max_length=256,
                                          verbose_name='收件地址')),
                ('zip_code',
                 models.CharField(max_length=6, null=True,
                                  verbose_name='邮政编码')),
                ('phone', models.CharField(max_length=11,
                                           verbose_name='联系电话')),
                ('is_default',
                 models.BooleanField(default=False, verbose_name='是否默认')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='所属账户')),
            ],
            options={
                'verbose_name': '地址',
                'verbose_name_plural': '地址',
                'db_table': 'user_address',
            },
        ),
        migrations.AddField(
            model_name='orderinfo',
            name='addr',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.UserAddress',
                verbose_name='地址'),
        ),
        migrations.AddField(
            model_name='orderinfo',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='用户'),
        ),
        migrations.AddField(
            model_name='ordergoods',
            name='order',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.OrderInfo',
                verbose_name='订单'),
        ),
        migrations.AddField(
            model_name='ordergoods',
            name='sku',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.Goods',
                verbose_name='商品'),
        ),
    ]
Beispiel #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=20,
                                          verbose_name='商品SPU名称')),
                ('detail',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   verbose_name='商品详情')),
            ],
            options={
                'verbose_name': '商品SPU',
                'verbose_name_plural': '商品SPU',
                'db_table': 'df_goods',
            },
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('image',
                 models.ImageField(upload_to='goods', verbose_name='图片路径')),
            ],
            options={
                'verbose_name': '商品图片',
                'verbose_name_plural': '商品图片',
                'db_table': 'df_goods_image',
            },
        ),
        migrations.CreateModel(
            name='GoodsSKU',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=20, verbose_name='商品名称')),
                ('desc', models.CharField(max_length=256,
                                          verbose_name='商品简介')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='价格')),
                ('unite', models.CharField(max_length=20,
                                           verbose_name='商品单位')),
                ('image',
                 models.ImageField(upload_to='goods', verbose_name='商品图片')),
                ('stock', models.IntegerField(default=1, verbose_name='商品库存')),
                ('sales', models.IntegerField(default=0, verbose_name='商品销量')),
                ('status',
                 models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')],
                                          default=1,
                                          verbose_name='状态')),
                ('goods',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.Goods',
                                   verbose_name='商品SPU')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
                'db_table': 'df_goods_sku',
            },
        ),
        migrations.CreateModel(
            name='GoodsType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=20, verbose_name='种类名称')),
                ('logo', models.CharField(max_length=20, verbose_name='标识')),
                ('image',
                 models.ImageField(upload_to='type', verbose_name='商品类型图片')),
            ],
            options={
                'verbose_name': '商品种类',
                'verbose_name_plural': '商品种类',
                'db_table': 'df_goods_type',
            },
        ),
        migrations.CreateModel(
            name='IndexGoodsBanner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('image',
                 models.ImageField(upload_to='banner', verbose_name='图片')),
                ('index',
                 models.SmallIntegerField(default=0, verbose_name='展示顺序')),
                ('sku',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsSKU',
                                   verbose_name='商品')),
            ],
            options={
                'verbose_name': '首页轮播商品',
                'verbose_name_plural': '首页轮播商品',
                'db_table': 'df_index_banner',
            },
        ),
        migrations.CreateModel(
            name='IndexPromotionBanner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=20, verbose_name='活动名称')),
                ('url', models.URLField(verbose_name='活动链接')),
                ('image',
                 models.ImageField(upload_to='banner', verbose_name='活动图片')),
                ('index',
                 models.SmallIntegerField(default=0, verbose_name='展示顺序')),
            ],
            options={
                'verbose_name': '主页促销活动',
                'verbose_name_plural': '主页促销活动',
                'db_table': 'df_index_promotion',
            },
        ),
        migrations.CreateModel(
            name='IndexTypeGoodsBanner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('display_type',
                 models.SmallIntegerField(choices=[(0, '标题'), (1, '图片')],
                                          default=1,
                                          verbose_name='展示类型')),
                ('index',
                 models.SmallIntegerField(default=1, verbose_name='展示顺序')),
                ('sku',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsSKU',
                                   verbose_name='商品SKU')),
                ('type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsType',
                                   verbose_name='商品类型')),
            ],
            options={
                'verbose_name': '主页分类展示商品',
                'verbose_name_plural': '主页分类展示商品',
                'db_table': 'df_index_type_goods',
            },
        ),
        migrations.AddField(
            model_name='goodssku',
            name='type',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.GoodsType',
                verbose_name='商品种类'),
        ),
        migrations.AddField(
            model_name='goodsimage',
            name='sku',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.GoodsSKU',
                verbose_name='商品'),
        ),
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='GoodsCountry',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('Country', models.CharField(max_length=20,
                                             verbose_name='区域')),
            ],
            options={
                'verbose_name': '区域',
                'verbose_name_plural': '区域',
                'db_table': 'df_Country',
            },
        ),
        migrations.CreateModel(
            name='GoodsProvinces',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('city', models.CharField(max_length=20, verbose_name='城市')),
                ('type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsCountry',
                                   verbose_name='区域')),
            ],
            options={
                'verbose_name': '省份',
                'verbose_name_plural': '省份',
                'db_table': 'df_Provinces',
            },
        ),
        migrations.CreateModel(
            name='GoodsSKU',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('name', models.CharField(max_length=20, verbose_name='景区名称')),
                ('desc', models.CharField(max_length=256,
                                          verbose_name='景区介绍')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='最低价格')),
                ('hightprice',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='最高价格')),
                ('num',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='浏览人数')),
                ('image',
                 models.ImageField(upload_to='goods', verbose_name='商品缩略图')),
                ('stock', models.IntegerField(default=1, verbose_name='商品库存')),
                ('sales', models.IntegerField(default=0, verbose_name='景点销量')),
                ('ranking',
                 models.SmallIntegerField(default=0, verbose_name='展示顺序')),
                ('css_stays',
                 models.CharField(max_length=20, verbose_name='图片样式')),
                ('status',
                 models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')],
                                          default=1,
                                          verbose_name='景点状态')),
                ('type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsProvinces',
                                   verbose_name='城市名')),
            ],
            options={
                'verbose_name': '景点名称',
                'verbose_name_plural': '景点名称',
                'db_table': 'df_goods_sku',
            },
        ),
        migrations.CreateModel(
            name='GoodsSPU',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('title', models.CharField(max_length=20,
                                           verbose_name='景点标题')),
                ('author', models.CharField(max_length=20, verbose_name='作者')),
                ('content',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='内容')),
                ('name',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsSKU',
                                   verbose_name='景点名称')),
            ],
            options={
                'verbose_name': '景点内容',
                'verbose_name_plural': '景点内容',
                'db_table': 'df_goods_spu',
            },
        ),
        migrations.CreateModel(
            name='goodsphoto',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('update_time',
                 models.DateTimeField(auto_now=True, verbose_name='更新时间')),
                ('is_delete',
                 models.BooleanField(default=False, verbose_name='删除标记')),
                ('content',
                 models.ImageField(upload_to='goods', verbose_name='景点组图')),
                ('name',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsSKU',
                                   verbose_name='景点名称')),
            ],
            options={
                'verbose_name': '景点图片',
                'verbose_name_plural': '景点图片',
                'db_table': 'df_goods_spu_photo',
            },
        ),
    ]
Beispiel #9
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Goods',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20,
                                          verbose_name='商品SPU名称')),
                ('detail',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='内容')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '商品SPU',
                'verbose_name_plural': '商品SPU',
                'db_table': 'df_goods',
            },
        ),
        migrations.CreateModel(
            name='GoodsImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to='goods', verbose_name='图片路径')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '商品图片',
                'verbose_name_plural': '商品图片',
                'db_table': 'df_goods_image',
            },
        ),
        migrations.CreateModel(
            name='GoodsSKU',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='商品名称')),
                ('desc', models.CharField(max_length=256,
                                          verbose_name='商品简介')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     verbose_name='商品价格')),
                ('unite', models.CharField(max_length=20,
                                           verbose_name='商品单位')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='goods/images/',
                                   verbose_name='商品图片')),
                ('stock', models.IntegerField(default=1, verbose_name='商品库存')),
                ('sales', models.IntegerField(default=0, verbose_name='商品销量')),
                ('click_num', models.IntegerField(default=0,
                                                  verbose_name='点击数')),
                ('fav_num', models.IntegerField(default=0,
                                                verbose_name='收藏数')),
                ('status',
                 models.SmallIntegerField(choices=[(0, '下线'), (1, '上线')],
                                          default=1,
                                          verbose_name='商品状态')),
                ('is_new',
                 models.BooleanField(default=False, verbose_name='是否新品')),
                ('is_hot',
                 models.BooleanField(default=False, verbose_name='是否热销')),
                ('is_recommend',
                 models.BooleanField(default=False, verbose_name='是否推荐')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('goods',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.Goods',
                                   verbose_name='商品SPU')),
            ],
            options={
                'verbose_name': '商品',
                'verbose_name_plural': '商品',
                'db_table': 'df_goods_sku',
            },
        ),
        migrations.CreateModel(
            name='GoodsType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='种类名称')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '商品种类',
                'verbose_name_plural': '商品种类',
                'db_table': 'df_goods_type',
            },
        ),
        migrations.CreateModel(
            name='IndexGoodsBanner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to='banner', verbose_name='图片')),
                ('index',
                 models.SmallIntegerField(default=0, verbose_name='展示顺序')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('sku',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='goods.GoodsSKU',
                                   verbose_name='商品')),
            ],
            options={
                'verbose_name': '首页轮播商品',
                'verbose_name_plural': '首页轮播商品',
                'db_table': 'df_index_banner',
            },
        ),
        migrations.CreateModel(
            name='IndexPromotionBanner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='活动名称')),
                ('url', models.URLField(verbose_name='活动链接')),
                ('image',
                 models.ImageField(upload_to='banner', verbose_name='活动图片')),
                ('index',
                 models.SmallIntegerField(default=0, verbose_name='展示顺序')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '主页促销活动',
                'verbose_name_plural': '主页促销活动',
                'db_table': 'df_index_promotion',
            },
        ),
        migrations.AddField(
            model_name='goodssku',
            name='type',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.GoodsType',
                verbose_name='商品种类'),
        ),
        migrations.AddField(
            model_name='goodsimage',
            name='sku',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='goods.GoodsSKU',
                verbose_name='商品'),
        ),
    ]
Beispiel #10
0
class Migration(migrations.Migration):

    initial = True

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

    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')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('number_id',
                 models.CharField(error_messages={'unique': '该学工号已经注册!请检查!'},
                                  help_text='请输入正确的学工号用于系统登录',
                                  max_length=15,
                                  unique=True,
                                  validators=[
                                      django.contrib.auth.validators.
                                      UnicodeUsernameValidator()
                                  ],
                                  verbose_name='学工号')),
                ('name', models.CharField(max_length=50, verbose_name='姓名')),
            ],
            options={
                'verbose_name': '用户',
                'verbose_name_plural': '用户',
                'ordering': ['number_id'],
            },
        ),
        migrations.CreateModel(
            name='ArticleCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category_name',
                 models.CharField(max_length=50, verbose_name='栏目二级分类名称')),
            ],
            options={
                'verbose_name': '栏目二级分类',
                'verbose_name_plural': '栏目二级分类',
            },
        ),
        migrations.CreateModel(
            name='ArticleColumn',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('column_name',
                 models.CharField(max_length=50, verbose_name='栏目名称')),
            ],
            options={
                'verbose_name': '文章栏目',
                'verbose_name_plural': '文章栏目',
            },
        ),
        migrations.CreateModel(
            name='BaseArticle',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('heading', models.CharField(max_length=50,
                                             verbose_name='标题')),
                ('subheading',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=50,
                                  verbose_name='副标题')),
                ('author',
                 models.CharField(choices=[('0', '我自己'), ('1', '匿名'),
                                           ('2', '未知')],
                                  default='0',
                                  max_length=15,
                                  verbose_name='作者')),
                ('source',
                 models.CharField(choices=[('0', '本站原创'), ('1', '转载'),
                                           ('2', '未知'), ('3', '来自网络')],
                                  default='0',
                                  max_length=15,
                                  verbose_name='来源')),
                ('open_jmp_url',
                 models.BooleanField(default=False, verbose_name='启用转向链接')),
                ('jmp_url',
                 models.URLField(blank=True, default='', verbose_name='转向链接')),
                ('content',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   verbose_name='正文')),
                ('index_img',
                 models.BooleanField(default=True, verbose_name='从本文获取首页图片')),
                ('index_img_url',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='首页图片地址')),
                ('article_top',
                 models.BooleanField(default=False, verbose_name='置顶文章')),
                ('article_hot',
                 models.BooleanField(default=False, verbose_name='热门文章')),
                ('c_time',
                 models.DateField(auto_now_add=True, verbose_name='录入时间')),
            ],
            options={
                'verbose_name': '文章',
                'verbose_name_plural': '文章',
                'ordering': ['-c_time', 'article_top', 'article_hot'],
            },
        ),
        migrations.CreateModel(
            name='Carousel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('pic',
                 models.ImageField(upload_to='index-img',
                                   verbose_name='图片(规格: 1190*398)')),
                ('headline',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=80,
                                  verbose_name='标题')),
                ('display_level',
                 models.IntegerField(default=1, verbose_name='显示顺序')),
            ],
            options={
                'verbose_name': '首页轮播图',
                'verbose_name_plural': '首页轮播图',
                'ordering': ['display_level'],
            },
        ),
        migrations.CreateModel(
            name='Connection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('display_level', models.IntegerField(verbose_name='显示等级')),
                ('job_tile',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='职务')),
                ('job',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='职责')),
                ('phone',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=100,
                                  verbose_name='电话')),
                ('email',
                 models.EmailField(blank=True,
                                   default='',
                                   max_length=254,
                                   verbose_name='Email')),
            ],
            options={
                'verbose_name': '职责关系',
                'verbose_name_plural': '职责关系',
                'ordering': ['group_fk', 'display_level'],
            },
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(max_length=20,
                                  unique=True,
                                  verbose_name='组织名字')),
                ('type',
                 models.CharField(choices=[('0', '组织'), ('1', '社团'),
                                           ('2', '实验室'), ('3', '其他')],
                                  default=0,
                                  max_length=10,
                                  verbose_name='组织类型')),
                ('pic',
                 models.ImageField(blank=True,
                                   upload_to='org-img',
                                   verbose_name='组织图片')),
                ('link_url',
                 models.URLField(blank=True, default='', verbose_name='组织网址')),
            ],
            options={
                'verbose_name': '组织',
                'verbose_name_plural': '组织',
            },
        ),
        migrations.CreateModel(
            name='HZBX',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('heading', models.CharField(max_length=50,
                                             verbose_name='标题')),
                ('content',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   verbose_name='正文')),
                ('c_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='录入时间')),
                ('publisher',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='发表人')),
            ],
            options={
                'verbose_name': '合作办学',
                'verbose_name_plural': '合作办学',
            },
        ),
        migrations.CreateModel(
            name='Introduce',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('department',
                 models.CharField(choices=[('0', '学院'), ('1', '物理系'),
                                           ('2', '电子工程系'), ('3', '计算机科学与技术系'),
                                           ('4', '海洋技术系'), ('5', '信息工程系'),
                                           ('6', '物理学'), ('7', '光信息科学与技术'),
                                           ('8', '电子信息科学与技术'), ('9', '电子信息工程'),
                                           ('10', '通信工程'), ('11', '计算机科学与技术'),
                                           ('12', '海洋技术')],
                                  default=0,
                                  help_text='院系介绍选择结尾为系,专业介绍结尾无系',
                                  max_length=20,
                                  verbose_name='院系专业')),
                ('content',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   verbose_name='正文')),
            ],
            options={
                'verbose_name': '院系、专业介绍',
                'verbose_name_plural': '院系、专业介绍',
                'ordering': ['department'],
            },
        ),
        migrations.CreateModel(
            name='IPRecord',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ip_addr', models.GenericIPAddressField(verbose_name='IP地址')),
                ('time',
                 models.DateTimeField(auto_now=True, verbose_name='登录时间')),
                ('user_fk',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='管理员')),
            ],
            options={
                'verbose_name': '登录记录',
                'verbose_name_plural': '登录记录',
                'ordering': ['-time'],
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('pic',
                 models.ImageField(blank=True,
                                   upload_to='user-head',
                                   verbose_name='上传照片')),
                ('birthday', models.DateField(verbose_name='生日')),
                ('politics_status',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=20,
                                  verbose_name='政治面貌')),
                ('education',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=50,
                                  verbose_name='学历')),
                ('mobile_phone',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=15,
                                  verbose_name='移动电话')),
                ('office_phone',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=15,
                                  verbose_name='办公电话')),
                ('email',
                 models.EmailField(blank=True,
                                   default='',
                                   max_length=254,
                                   verbose_name='Email')),
                ('workplace',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=50,
                                  verbose_name='办公室')),
                ('address',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=80,
                                  verbose_name='通信地址')),
                ('job_title',
                 models.CharField(choices=[('0', '教授'), ('1', '副教授'),
                                           ('2', '高级工程师'), ('3', '高级实验师'),
                                           ('4', '讲师'), ('5', '助理工程师'),
                                           ('6', '助理实验师'), ('7', '其他')],
                                  default=0,
                                  max_length=10,
                                  verbose_name='职称')),
                ('job',
                 models.CharField(choices=[('0', '院长'), ('1', '副院长'),
                                           ('2', '系主任'), ('3', '副系主任'),
                                           ('4', '其他')],
                                  default=0,
                                  max_length=10,
                                  verbose_name='职务')),
                ('tutor',
                 models.CharField(choices=[('0', '博士生导师'), ('1', '硕士生导师'),
                                           ('2', '其他')],
                                  default=0,
                                  max_length=10,
                                  verbose_name='导师')),
                ('department',
                 models.CharField(choices=[('0', '物理系'), ('1', '电子工程系'),
                                           ('2', '计算机科学与技术系'), ('3', '海洋技术系'),
                                           ('4', '信息工程中心'), ('5', '行政人员')],
                                  default=0,
                                  max_length=15,
                                  verbose_name='单位')),
                ('course',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='教授课程')),
                ('experience',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='教育及工作经历')),
                ('research_direction',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='研究方向')),
                ('research_project',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='科研项目')),
                ('achievements',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='学术成果')),
                ('paper',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='论文专利')),
                ('enrolment',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='研究生招生条件')),
                ('remark',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='备注')),
                ('user_fk',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户详细信息',
                'verbose_name_plural': '用户详细信息',
            },
        ),
        migrations.CreateModel(
            name='Teach_Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('course_name',
                 models.CharField(max_length=50, verbose_name='课程名称')),
                ('department',
                 models.CharField(choices=[('0', '物理系'), ('1', '电子工程系'),
                                           ('2', '计算机科学与技术系'), ('3', '海洋技术系')],
                                  default=0,
                                  max_length=20,
                                  verbose_name='开课院系')),
                ('major',
                 models.CharField(choices=[('0', '物理学'), ('1', '光信息科学与技术'),
                                           ('2', '电子信息科学与技术'), ('3', '电子信息工程'),
                                           ('4', '通信工程'), ('5', '计算机科学与技术'),
                                           ('6', '海洋技术')],
                                  default=0,
                                  max_length=20,
                                  verbose_name='所属专业')),
                ('course_type',
                 models.CharField(choices=[('0', '无实验理论课或纯试验课程'),
                                           ('1', '含实验理论课'),
                                           ('2', '课程设计(或以周为教学单位的试验课)')],
                                  default=0,
                                  max_length=30,
                                  verbose_name='课程类型')),
                ('course_id',
                 models.CharField(max_length=30, verbose_name='课程编号')),
                ('course_name_english',
                 models.CharField(max_length=100, verbose_name='课程英文名称')),
                ('course_hours',
                 models.SmallIntegerField(verbose_name='课程总学时')),
                ('course_credit', models.FloatField(verbose_name='课程总学分')),
                ('experiment_hours',
                 models.SmallIntegerField(verbose_name='含实验或实践学时')),
                ('experiment_credit',
                 models.FloatField(verbose_name='含实验或实践学分')),
                ('recommend_book',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='推荐使用教材')),
                ('recommend_book_author',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='推荐使用教材编者')),
                ('recommend_book_publisher',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='推荐使用教材出版社')),
                ('recommend_book_time_version',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='推荐使用教材出版时间及版次')),
                ('course_object',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='课程教学目标与基本要求')),
                ('quiz_type',
                 models.CharField(max_length=20, verbose_name='考试形式')),
                ('referance_book',
                 it.models.NormalTextField(blank=True,
                                           default='',
                                           verbose_name='学习参考书')),
                ('additional_file',
                 models.FileField(blank=True,
                                  upload_to='course-file',
                                  verbose_name='上传更多信息')),
            ],
            options={
                'verbose_name': '课程列表',
                'verbose_name_plural': '课程列表',
            },
        ),
        migrations.CreateModel(
            name='Teach_Plan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('major',
                 models.CharField(choices=[('0', '物理学'), ('1', '光信息科学与技术'),
                                           ('2', '电子信息科学与技术'), ('3', '电子信息工程'),
                                           ('4', '电子信息工程中法卓越班'), ('5', '通信工程'),
                                           ('6', '计算机科学与技术'), ('7', '海洋技术')],
                                  default='0',
                                  max_length=20,
                                  verbose_name='专业')),
                ('u_time', models.DateField(auto_now=True,
                                            verbose_name='上传时间')),
                ('file',
                 models.FileField(blank=True,
                                  upload_to='teach-plan',
                                  verbose_name='替换上传')),
            ],
            options={
                'verbose_name': '培养计划',
                'verbose_name_plural': '培养计划',
                'ordering': ['major'],
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('basearticle_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='it.BaseArticle')),
                ('is_official',
                 models.BooleanField(default=True, verbose_name='学院官方')),
            ],
            options={
                'verbose_name': '学院新闻',
                'verbose_name_plural': '学院新闻',
            },
            bases=('it.basearticle', ),
        ),
        migrations.CreateModel(
            name='XSBG',
            fields=[
                ('basearticle_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='it.BaseArticle')),
                ('meeting_place',
                 models.CharField(max_length=100, verbose_name='举办地点')),
                ('meeting_time', models.DateTimeField(verbose_name='举办时间')),
            ],
            options={
                'verbose_name': '学术报告',
                'verbose_name_plural': '学术报告',
            },
            bases=('it.basearticle', ),
        ),
        migrations.AddField(
            model_name='connection',
            name='group_fk',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='it.Group',
                verbose_name='组织'),
        ),
        migrations.AddField(
            model_name='connection',
            name='users_fk',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='组员'),
        ),
        migrations.AddField(
            model_name='basearticle',
            name='category',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='it.ArticleCategory',
                verbose_name='栏目分类'),
        ),
        migrations.AddField(
            model_name='basearticle',
            name='column',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='it.ArticleColumn',
                verbose_name='文章发表栏目'),
        ),
        migrations.AddField(
            model_name='basearticle',
            name='publisher',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='发表人'),
        ),
        migrations.AddField(
            model_name='articlecategory',
            name='belong_column',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='category',
                to='it.ArticleColumn'),
        ),
        migrations.AddField(
            model_name='myuser',
            name='groups',
            field=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'),
        ),
        migrations.AddField(
            model_name='myuser',
            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'),
        ),
        migrations.AlterUniqueTogether(
            name='connection',
            unique_together=set([('group_fk', 'users_fk')]),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0002_userinfo'),
        ('experiments', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Lab',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lab_alias', models.CharField(max_length=100, verbose_name='实验别名')),
                ('lab_gua_user', models.CharField(max_length=100, verbose_name='guacamole用户名')),
                ('lab_remark', models.CharField(max_length=300, verbose_name='lab 备注')),
            ],
            options={
                'verbose_name': 'lab实验表',
                'verbose_name_plural': 'lab实验表',
            },
        ),
        migrations.CreateModel(
            name='LabModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lab_name', models.CharField(max_length=100, verbose_name='lab名称')),
                ('lab_tb', models.CharField(max_length=500, verbose_name='lab时间段')),
                ('lab_doc', DjangoUeditor.models.UEditorField(verbose_name='lab文档')),
            ],
            options={
                'verbose_name': 'lab实验模型',
                'verbose_name_plural': 'lab实验模型',
            },
        ),
        migrations.CreateModel(
            name='Rack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rack_name', models.CharField(max_length=100, verbose_name='Rock名称')),
                ('rack_host', models.CharField(max_length=100, verbose_name='Rock host')),
                ('rack_port', models.CharField(max_length=100, verbose_name='Rock port')),
                ('rack_user', models.CharField(max_length=100, verbose_name='Rock user')),
                ('rack_pwd', models.CharField(max_length=100, verbose_name='Rock pwd')),
                ('rack_remark', models.CharField(max_length=300, verbose_name='Rock 备注')),
                ('rack_show', models.SmallIntegerField(default=1, verbose_name='是否显示')),
            ],
            options={
                'verbose_name': 'rack表',
                'verbose_name_plural': 'rack表',
            },
        ),
        migrations.CreateModel(
            name='ReservationInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='预约日期')),
                ('tb_id', models.CharField(max_length=20, verbose_name='预约时段')),
                ('lab', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='experiments.Lab', verbose_name='labid')),
                ('rack', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='experiments.Rack', verbose_name='rackid')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.UserInfo', verbose_name='用户名')),
            ],
            options={
                'verbose_name': '实验预约信息表',
                'verbose_name_plural': '实验预约信息表',
            },
        ),
        migrations.CreateModel(
            name='VMS',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vm_name', models.CharField(max_length=100, verbose_name='虚拟机名称')),
                ('vm_id', models.CharField(max_length=100, verbose_name='虚拟机id')),
                ('vm_snapshot', models.CharField(max_length=100, verbose_name='虚拟机快照')),
                ('vm_snapshot_id', models.CharField(max_length=100, verbose_name='虚拟机快照id')),
                ('vm_remark', models.CharField(max_length=300, verbose_name='备注')),
                ('lab_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='experiments.Lab', verbose_name='labid')),
                ('rack_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='experiments.Rack', verbose_name='rackid')),
            ],
            options={
                'verbose_name': '虚拟机列表',
                'verbose_name_plural': '虚拟机列表',
            },
        ),
        migrations.AddField(
            model_name='lab',
            name='lab_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='lab_m', to='experiments.LabModel', verbose_name='实验模型'),
        ),
        migrations.AddField(
            model_name='lab',
            name='lab_rack_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='r_rack', to='experiments.Rack', verbose_name='rackid'),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='ChoiceBank',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='题库名称')),
                ('desc',
                 models.CharField(blank=True,
                                  max_length=200,
                                  null=True,
                                  verbose_name='题库描述')),
                ('click_nums',
                 models.IntegerField(default=0, verbose_name='点击数')),
                ('complete_times',
                 models.IntegerField(default=0, verbose_name='建议完成时长(分钟数)')),
                ('is_complete',
                 models.BooleanField(default=False, verbose_name='是否完成')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '选择题库',
                'verbose_name_plural': '选择题库',
            },
        ),
        migrations.CreateModel(
            name='ChoiceQuestion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('question_num', models.IntegerField(verbose_name='题目编号')),
                ('question_content',
                 models.CharField(max_length=500, verbose_name='题目内容')),
                ('choiceA', models.CharField(max_length=200,
                                             verbose_name='选项A')),
                ('choiceB', models.CharField(max_length=200,
                                             verbose_name='选项B')),
                ('choiceC', models.CharField(max_length=200,
                                             verbose_name='选项C')),
                ('choiceD', models.CharField(max_length=200,
                                             verbose_name='选项D')),
                ('answer',
                 models.SmallIntegerField(choices=[(1, 'A'), (2, 'B'),
                                                   (3, 'C'), (4, 'D')],
                                          default=0,
                                          verbose_name='答案')),
                ('explain', models.TextField(verbose_name='答案解释')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('choicebank',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.ChoiceBank',
                                   verbose_name='选择题库')),
            ],
            options={
                'verbose_name': '选择题',
                'verbose_name_plural': '选择题',
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='课程名')),
                ('desc', models.CharField(max_length=300,
                                          verbose_name='课程描述')),
                ('detail',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='课程详情')),
                ('degree',
                 models.CharField(choices=[('cj', '初级'), ('zj', '中级'),
                                           ('gj', '高级')],
                                  max_length=2,
                                  verbose_name='难度')),
                ('learn_times',
                 models.IntegerField(default=0, verbose_name='建议学习时长')),
                ('students', models.IntegerField(default=0,
                                                 verbose_name='学习人数')),
                ('fav_nums', models.IntegerField(default=0,
                                                 verbose_name='收藏人数')),
                ('image',
                 models.ImageField(upload_to='courses/%Y/%m',
                                   verbose_name='课程封面')),
                ('click_nums',
                 models.IntegerField(default=0, verbose_name='点击数')),
                ('direction',
                 models.CharField(choices=[('base', '基础课程'),
                                           ('project', '项目课程')],
                                  default='base',
                                  max_length=10,
                                  verbose_name='课程方向')),
                ('tag',
                 models.CharField(default='',
                                  max_length=10,
                                  verbose_name='课程标签')),
                ('youneed_know',
                 models.CharField(default='',
                                  max_length=300,
                                  verbose_name='课程须知')),
                ('teacher_tell',
                 models.CharField(default='',
                                  max_length=300,
                                  verbose_name='老师告诉你')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '课程',
                'verbose_name_plural': '课程',
            },
        ),
        migrations.CreateModel(
            name='CourseCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category',
                 models.CharField(max_length=36, verbose_name='课程分类')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '课程分类',
                'verbose_name_plural': '课程分类',
            },
        ),
        migrations.CreateModel(
            name='CourseDirection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('direction',
                 models.CharField(max_length=36, verbose_name='课程方向')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '课程方向',
                'verbose_name_plural': '课程方向',
            },
        ),
        migrations.CreateModel(
            name='Faq',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('question', models.CharField(max_length=500,
                                              verbose_name='问题')),
                ('answer', models.CharField(max_length=1500,
                                            verbose_name='回答')),
            ],
            options={
                'verbose_name': 'FAQ',
                'verbose_name_plural': 'FAQ',
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='关卡名')),
                ('image',
                 models.ImageField(default='',
                                   max_length=128,
                                   upload_to='',
                                   verbose_name='关卡图')),
                ('learn_times',
                 models.IntegerField(default=0, verbose_name='建议完成时长')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('learn_require',
                 models.CharField(max_length=300, verbose_name='关卡学习要求')),
                ('learn_target',
                 models.CharField(max_length=300, verbose_name='关卡学习目标')),
                ('resource',
                 models.CharField(max_length=300, verbose_name='关卡学习资源网盘地址')),
                ('tutorial',
                 models.CharField(default='',
                                  max_length=200,
                                  verbose_name='关卡教程地址')),
                ('opt_require',
                 models.CharField(max_length=300, verbose_name='关卡实操要求')),
                ('ext_resource',
                 models.CharField(max_length=300, verbose_name='关卡扩展资源网盘地址')),
                ('choice_detail',
                 models.CharField(default='',
                                  max_length=100,
                                  verbose_name='选择题描述')),
                ('program_detail',
                 models.CharField(default='',
                                  max_length=100,
                                  verbose_name='编程题描述')),
                ('open_level',
                 models.BooleanField(default=False, verbose_name='开通关卡')),
                ('pass_level',
                 models.BooleanField(default=False, verbose_name='通过关卡')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Course',
                                   verbose_name='课程')),
            ],
            options={
                'verbose_name': '课程关卡',
                'verbose_name_plural': '课程关卡',
            },
        ),
        migrations.CreateModel(
            name='ProgramBank',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='题库名称')),
                ('desc',
                 models.CharField(blank=True,
                                  max_length=200,
                                  null=True,
                                  verbose_name='题库描述')),
                ('click_nums',
                 models.IntegerField(default=0, verbose_name='点击数')),
                ('complete_times',
                 models.IntegerField(default=0, verbose_name='建议完成时长(分钟数)')),
                ('is_complete',
                 models.BooleanField(default=False, verbose_name='是否完成')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('lesson',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Lesson',
                                   verbose_name='课程关卡')),
            ],
            options={
                'verbose_name': '实操题库',
                'verbose_name_plural': '实操题库',
            },
        ),
        migrations.CreateModel(
            name='ProgramQuestion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('question_num', models.IntegerField(verbose_name='题目编号')),
                ('question_title',
                 models.CharField(default='',
                                  max_length=36,
                                  verbose_name='编程题目')),
                ('question_content', models.TextField(verbose_name='题目内容')),
                ('download',
                 models.FileField(default='',
                                  upload_to='program/download/%Y/%m',
                                  verbose_name='源码文件')),
                ('url',
                 models.CharField(default='',
                                  max_length=200,
                                  verbose_name='题目讲解视频地址')),
                ('essentials',
                 models.CharField(max_length=500, verbose_name='解题思路')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='program/image/%Y/%m',
                                   verbose_name='运行结果截图')),
                ('is_comment',
                 models.BooleanField(default=False, verbose_name='是否提供点评')),
                ('is_complete',
                 models.BooleanField(default=False, verbose_name='是否完成')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('lesson',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Lesson',
                                   verbose_name='课程关卡')),
                ('program_bank',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.ProgramBank',
                                   verbose_name='实操题库')),
            ],
            options={
                'verbose_name': '编程题',
                'verbose_name_plural': '编程题',
            },
        ),
        migrations.CreateModel(
            name='ProgramResultImg',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image', models.ImageField(upload_to='',
                                            verbose_name='运行截图')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '项目运行截图',
                'verbose_name_plural': '项目运行截图',
            },
        ),
        migrations.CreateModel(
            name='ProgramUpload',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('upload',
                 models.FileField(blank=True,
                                  default='',
                                  null=True,
                                  upload_to='program/upload/file/%Y/%m',
                                  verbose_name='源码文件')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='program/upload/image/%Y/%m',
                                   verbose_name='运行结果截图')),
                ('grade',
                 models.CharField(blank=True,
                                  choices=[('优秀', 'A+'), ('优良', 'A'),
                                           ('良好', 'B'), ('及格', 'C'),
                                           ('不及格', 'D')],
                                  max_length=5,
                                  null=True,
                                  verbose_name='等级')),
                ('learned',
                 models.TextField(blank=True,
                                  default='',
                                  null=True,
                                  verbose_name='练习心得')),
                ('comment',
                 models.TextField(blank=True,
                                  default='',
                                  null=True,
                                  verbose_name='项目点评')),
                ('is_complete',
                 models.BooleanField(default=False, verbose_name='是否完成')),
                ('is_show',
                 models.BooleanField(default=False, verbose_name='是否展示')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('lesson',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Lesson',
                                   verbose_name='关卡')),
                ('programquestion',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.ProgramQuestion',
                                   verbose_name='编程题')),
                ('user',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='用户')),
            ],
            options={
                'verbose_name': '编程题结果',
                'verbose_name_plural': '编程题结果',
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='视频名')),
                ('learn_times',
                 models.IntegerField(default=0, verbose_name='视频时长(分钟数)')),
                ('url',
                 models.CharField(default='',
                                  max_length=200,
                                  verbose_name='访问地址')),
                ('add_time',
                 models.DateTimeField(default=datetime.datetime.now,
                                      verbose_name='添加时间')),
                ('lesson',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='courses.Lesson',
                                   verbose_name='课程关卡')),
            ],
            options={
                'verbose_name': '视频',
                'verbose_name_plural': '视频',
            },
        ),
        migrations.AddField(
            model_name='programresultimg',
            name='programupload',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='courses.ProgramUpload',
                verbose_name='编程题结果'),
        ),
        migrations.AddField(
            model_name='faq',
            name='lesson',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='courses.Lesson',
                verbose_name='课程关卡'),
        ),
        migrations.AddField(
            model_name='course',
            name='coursecategory',
            field=models.ForeignKey(
                default='',
                on_delete=django.db.models.deletion.CASCADE,
                to='courses.CourseCategory',
                verbose_name='课程分类'),
        ),
        migrations.AddField(
            model_name='choicequestion',
            name='lesson',
            field=models.ForeignKey(
                default='',
                on_delete=django.db.models.deletion.CASCADE,
                to='courses.Lesson',
                verbose_name='课程关卡'),
        ),
        migrations.AddField(
            model_name='choicebank',
            name='lesson',
            field=models.ForeignKey(
                default='',
                on_delete=django.db.models.deletion.CASCADE,
                to='courses.Lesson',
                verbose_name='课程关卡'),
        ),
    ]
Beispiel #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='QaHead',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ftesttyp', models.CharField(max_length=6,
                                              verbose_name='测试类型')),
                ('fsystemcd',
                 models.CharField(max_length=20, verbose_name='系统名称')),
                ('fprojectcd',
                 models.CharField(max_length=20, verbose_name='项目名称')),
                ('fslipno', models.CharField(max_length=20,
                                             verbose_name='联络票号')),
                ('fobjectid',
                 models.CharField(max_length=50, verbose_name='测试对象')),
                ('fobjectnm',
                 models.CharField(max_length=50, verbose_name='测试对象')),
                ('fcreatedte',
                 models.DateField(auto_now_add=True, verbose_name='创建日期')),
                ('fcreateusr',
                 models.CharField(max_length=24, verbose_name='创建者')),
                ('fstatus', models.CharField(max_length=1, verbose_name='状态')),
                ('fauditdte',
                 models.DateField(blank=True, null=True, verbose_name='审核日期')),
                ('fauditor',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='审核者')),
                ('ftestdte',
                 models.DateField(blank=True, null=True, verbose_name='测试日期')),
                ('ftestusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='测试者')),
                ('fconfirmdte',
                 models.DateField(blank=True, null=True, verbose_name='确认日期')),
                ('fconfirmusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='确认者')),
                ('fttlcodelines',
                 models.SmallIntegerField(default=0, verbose_name='影响总行数')),
                ('fmodifiedlines',
                 models.SmallIntegerField(default=0, verbose_name='修改行数')),
                ('fcomplexity',
                 models.DecimalField(blank=True,
                                     decimal_places=1,
                                     max_digits=2,
                                     null=True,
                                     verbose_name='复杂度')),
                ('fnote',
                 models.TextField(blank=True, null=True, verbose_name='备注')),
                ('fobjmodification',
                 models.TextField(blank=True, null=True,
                                  verbose_name='程序修改概要')),
                ('freviewcode',
                 models.TextField(blank=True, null=True,
                                  verbose_name='程序确认结果')),
                ('flevel',
                 models.CharField(blank=True,
                                  max_length=2,
                                  null=True,
                                  verbose_name='难易等级')),
                ('fentdt',
                 models.DateField(auto_now_add=True, verbose_name='登入日期')),
                ('fentusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='登录者')),
                ('fupdtedt',
                 models.DateField(blank=True, null=True, verbose_name='更新日期')),
                ('fupdteusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='更新者')),
                ('fupdteprg',
                 models.CharField(blank=True,
                                  max_length=110,
                                  null=True,
                                  verbose_name='更新程序名')),
            ],
            options={
                'verbose_name': '测试头表',
                'verbose_name_plural': '测试头表',
                'db_table': 'qahf',
            },
        ),
        migrations.CreateModel(
            name='QaDetail',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('fclass1',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='分类1')),
                ('fclass2',
                 models.CharField(blank=True,
                                  max_length=20,
                                  null=True,
                                  verbose_name='分类2')),
                ('fregression',
                 models.CharField(max_length=1, verbose_name='回归测试')),
                ('fcontent_text',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   null=True,
                                                   verbose_name='测试截图')),
                ('fcontent', models.TextField(verbose_name='测试用例')),
                ('ftestdte',
                 models.DateField(blank=True, null=True, verbose_name='测试日期')),
                ('ftestusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='测试者')),
                ('fimpdte',
                 models.DateField(auto_now_add=True, verbose_name='新建日期')),
                ('fimpusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='新建者')),
                ('fapproval',
                 models.CharField(default='N',
                                  max_length=1,
                                  verbose_name='审核标志')),
                ('fresult',
                 models.CharField(blank=True,
                                  max_length=10,
                                  null=True,
                                  verbose_name='测试结果')),
                ('fngcnt',
                 models.SmallIntegerField(default=0, verbose_name='NG次数')),
                ('fentdt',
                 models.DateField(auto_now_add=True, verbose_name='登入日期')),
                ('fentusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='登录者')),
                ('fupdtedt',
                 models.DateField(blank=True, null=True, verbose_name='更新日期')),
                ('fupdteusr',
                 models.CharField(blank=True,
                                  max_length=24,
                                  null=True,
                                  verbose_name='更新者')),
                ('fupdteprg',
                 models.CharField(blank=True,
                                  max_length=110,
                                  null=True,
                                  verbose_name='更新程序名')),
                ('fqahfid',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='qahf',
                                   to='qa.QaHead')),
            ],
            options={
                'verbose_name': '测试明细表',
                'verbose_name_plural': '测试明细表',
                'db_table': 'qadf',
            },
        ),
    ]
Beispiel #14
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('albums', '0001_initial'),
        ('taggit', '0003_taggeditem_add_unique_index'),
    ]

    operations = [
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_tab',
                 models.BooleanField(default=False, verbose_name='是否目录')),
                ('name', models.CharField(max_length=255, verbose_name='章节名')),
                ('order',
                 models.SmallIntegerField(blank=True,
                                          db_index=True,
                                          default=0,
                                          help_text='自动递增',
                                          verbose_name='排序')),
                ('insert',
                 models.SmallIntegerField(blank=True,
                                          default=0,
                                          help_text='插入章节order',
                                          null=True,
                                          verbose_name='插入章节')),
                ('slug',
                 models.SlugField(blank=True,
                                  default='',
                                  max_length=255,
                                  verbose_name='(URL)别名')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='创建时间')),
                ('updated_at',
                 models.DateTimeField(auto_now=True,
                                      db_index=True,
                                      verbose_name='更新时间')),
            ],
            options={
                'verbose_name': '章节',
                'verbose_name_plural': '章节',
                'ordering': ('order', ),
            },
        ),
        migrations.CreateModel(
            name='Novel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='标题')),
                ('author', models.CharField(max_length=255,
                                            verbose_name='作者')),
                ('image',
                 models.ImageField(
                     blank=True,
                     null=True,
                     storage=quanbenxiaoshuo.storage.ImageStorage(),
                     upload_to='novel/%Y/%m',
                     verbose_name='小说封面')),
                ('info',
                 DjangoUeditor.models.UEditorField(default='',
                                                   verbose_name='简介')),
                ('title',
                 models.CharField(default='',
                                  help_text='title',
                                  max_length=255,
                                  verbose_name='标题(seo)')),
                ('keywords',
                 models.CharField(default='',
                                  help_text='keywords',
                                  max_length=255,
                                  verbose_name='关键字(seo)')),
                ('description',
                 models.CharField(default='',
                                  help_text='description',
                                  max_length=255,
                                  verbose_name='描述(seo)')),
                ('status',
                 models.CharField(choices=[('D', '不公开'), ('P', '公开')],
                                  default='D',
                                  max_length=1,
                                  verbose_name='状态')),
                ('slug',
                 models.SlugField(blank=True,
                                  default='',
                                  max_length=255,
                                  unique=True,
                                  verbose_name='(URL)别名')),
                ('is_full',
                 models.BooleanField(default=False, verbose_name='是否完本')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='创建时间')),
                ('updated_at',
                 models.DateTimeField(auto_now=True,
                                      db_index=True,
                                      verbose_name='更新时间')),
                ('album',
                 models.ManyToManyField(blank=True,
                                        related_name='album_novel',
                                        to='albums.Album',
                                        verbose_name='专辑')),
                ('category',
                 models.ManyToManyField(blank=True,
                                        related_name='category_novel',
                                        to='albums.Category',
                                        verbose_name='类别')),
                ('tags',
                 taggit.managers.TaggableManager(help_text='多个标签使用,(英文)隔开',
                                                 through='taggit.TaggedItem',
                                                 to='taggit.Tag',
                                                 verbose_name='小说类型')),
            ],
            options={
                'verbose_name': '小说',
                'verbose_name_plural': '小说',
                'ordering': ('-updated_at', ),
                'unique_together': {('name', 'author')},
                'index_together': {('status', 'slug')},
            },
        ),
        migrations.CreateModel(
            name='Content',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField(verbose_name='小说内容')),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='创建时间')),
                ('updated_at',
                 models.DateTimeField(auto_now=True,
                                      db_index=True,
                                      verbose_name='更新时间')),
                ('chapter',
                 models.ForeignKey(default='',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='chapter_content',
                                   to='novels.Chapter',
                                   verbose_name='小说章节')),
            ],
            options={
                'verbose_name': '小说内容',
                'verbose_name_plural': '小说内容',
            },
        ),
        migrations.AddField(
            model_name='chapter',
            name='novel',
            field=models.ForeignKey(
                default='',
                on_delete=django.db.models.deletion.CASCADE,
                related_name='novel_chapter',
                to='novels.Novel',
                verbose_name='小说名称'),
        ),
        migrations.AlterIndexTogether(
            name='chapter',
            index_together={('novel', 'id')},
        ),
    ]
Beispiel #15
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            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(max_length=64,
                                  unique=True,
                                  verbose_name='用户名')),
                ('is_active', models.BooleanField(default=True)),
                ('is_admin', models.BooleanField(default=False)),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BindHost',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
            options={
                'verbose_name_plural': '主机与用户绑定关系',
                'db_table': 'ops_bind_host',
            },
        ),
        migrations.CreateModel(
            name='BindUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('username',
                 models.CharField(max_length=32, validators=['用', '户', '名'])),
                ('ssh_type',
                 models.SmallIntegerField(choices=[(0, 'SSH/Password'),
                                                   (1, 'SSH/Key')],
                                          default=0,
                                          verbose_name='ssh类型')),
                ('password',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  validators=['密', '码'])),
                ('comment',
                 models.TextField(blank=True, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name_plural': '绑定的用户',
                'db_table': 'ops_bind_user',
            },
        ),
        migrations.CreateModel(
            name='IDC',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='机房')),
            ],
            options={
                'verbose_name_plural': '机房表',
                'db_table': 'ops_idc',
            },
        ),
        migrations.CreateModel(
            name='InstanceGroup',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
                ('bind_hosts', models.ManyToManyField(to='cmdb.BindHost')),
            ],
            options={
                'verbose_name_plural': '主机实例组',
                'db_table': 'ops_instance_group',
            },
        ),
        migrations.CreateModel(
            name='InstanceInfo',
            fields=[
                ('id',
                 models.CharField(max_length=64,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='实例ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='实例名称')),
                ('hostname',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='主机名')),
                ('key_pair_name',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='密钥')),
                ('os_type',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='系统类型')),
                ('os_name',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='系统名称')),
                ('cpu',
                 models.SmallIntegerField(default=1, verbose_name='CPU数量')),
                ('memory', models.IntegerField(default=2048,
                                               verbose_name='总内存')),
                ('mac_address',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='MAC地址')),
                ('zone_id',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='可用区')),
                ('serial_number',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='序列号')),
                ('status',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='状态')),
                ('recyclable',
                 models.BooleanField(default=False, verbose_name='可回收')),
                ('security_group_ids',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='安全组ID')),
                ('eip_address',
                 models.GenericIPAddressField(blank=True,
                                              null=True,
                                              verbose_name='弹性IP地址')),
                ('public_ip_address',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='公网IP')),
                ('primary_ip_address',
                 models.GenericIPAddressField(verbose_name='主IP地址')),
                ('private_ip_address',
                 models.GenericIPAddressField(blank=True,
                                              null=True,
                                              verbose_name='私有IP地址')),
                ('port', models.IntegerField(default=22,
                                             verbose_name='SSH端口')),
                ('creation_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('expired_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='到期时间')),
                ('enabled', models.BooleanField(default=True)),
                ('description',
                 models.TextField(blank=True, null=True, verbose_name='备注')),
                ('bind_user',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='cmdb.BindUser',
                     verbose_name='登陆用户')),
                ('idc',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='cmdb.IDC',
                                   verbose_name='服务商')),
            ],
            options={
                'verbose_name_plural': '主机实例信息',
                'db_table': 'ops_instance_info',
            },
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id',
                 models.CharField(max_length=64,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='区域编码')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='区域名称')),
                ('endpoint',
                 models.URLField(blank=True, null=True, verbose_name='API地址')),
                ('idc',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='cmdb.IDC',
                                   verbose_name='机房')),
            ],
            options={
                'verbose_name_plural': '可用区表',
                'db_table': 'ops_region',
            },
        ),
        migrations.CreateModel(
            name='ServiceUrl',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='服务名称')),
                ('web_url',
                 models.URLField(blank=True,
                                 max_length=128,
                                 null=True,
                                 verbose_name='Web URL地址')),
                ('real_url',
                 models.CharField(blank=True,
                                  max_length=128,
                                  null=True,
                                  verbose_name='后端URL')),
                ('connection',
                 models.SmallIntegerField(choices=[(1, 'HTTP'), (2, 'TCP')],
                                          default=1,
                                          verbose_name='协议')),
                ('auth',
                 models.SmallIntegerField(choices=[(1, '是'), (0, '否')],
                                          default=1,
                                          verbose_name='是否认证')),
                ('user',
                 models.CharField(blank=True,
                                  max_length=32,
                                  null=True,
                                  verbose_name='用户名')),
                ('password',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='密码')),
            ],
            options={
                'verbose_name_plural': '服务URL关系',
                'db_table': 'ops_service_url',
            },
        ),
        migrations.CreateModel(
            name='VPC',
            fields=[
                ('id',
                 models.CharField(max_length=64,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='VPC ID')),
                ('name',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='VPC名称')),
                ('is_default',
                 models.BooleanField(default=False, verbose_name='默认VPC')),
                ('status',
                 models.CharField(choices=[('Available', '在线'),
                                           ('unAvailable', '离线')],
                                  default='Available',
                                  max_length=16,
                                  verbose_name='状态')),
                ('cidr_block',
                 models.CharField(max_length=64, verbose_name='网段')),
                ('creation_time',
                 models.CharField(blank=True,
                                  max_length=64,
                                  null=True,
                                  verbose_name='创建时间')),
                ('description',
                 DjangoUeditor.models.UEditorField(blank=True,
                                                   default='',
                                                   verbose_name='内容')),
                ('region',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='cmdb.Region',
                                   verbose_name='区域')),
            ],
            options={
                'verbose_name_plural': 'VPC表',
                'db_table': 'ops_vpc',
            },
        ),
        migrations.CreateModel(
            name='WebHistory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.CharField(max_length=32,
                                  null=True,
                                  verbose_name='登录用户')),
                ('ip',
                 models.GenericIPAddressField(null=True, verbose_name='用户地址')),
                ('login_user',
                 models.CharField(max_length=32,
                                  null=True,
                                  verbose_name='所用账号')),
                ('host',
                 models.CharField(max_length=32,
                                  null=True,
                                  verbose_name='登录主机')),
                ('create_time',
                 models.DateTimeField(auto_now_add=True, verbose_name='时间')),
            ],
            options={
                'verbose_name_plural': '历史登录',
                'db_table': 'ops_web_history',
            },
        ),
        migrations.AddField(
            model_name='instanceinfo',
            name='region',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cmdb.Region',
                verbose_name='区域'),
        ),
        migrations.AddField(
            model_name='instanceinfo',
            name='vpc',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cmdb.VPC',
                verbose_name='所在VPC'),
        ),
        migrations.AddField(
            model_name='bindhost',
            name='host',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cmdb.InstanceInfo'),
        ),
        migrations.AddField(
            model_name='bindhost',
            name='remote_user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='cmdb.BindUser'),
        ),
        migrations.AddField(
            model_name='userprofile',
            name='bind_hosts',
            field=models.ManyToManyField(blank=True, to='cmdb.BindHost'),
        ),
        migrations.AddField(
            model_name='userprofile',
            name='groups',
            field=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'),
        ),
        migrations.AddField(
            model_name='userprofile',
            name='host_groups',
            field=models.ManyToManyField(blank=True, to='cmdb.InstanceGroup'),
        ),
        migrations.AddField(
            model_name='userprofile',
            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'),
        ),
        migrations.AlterUniqueTogether(
            name='bindhost',
            unique_together=set([('host', 'remote_user')]),
        ),
    ]