Пример #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('wagtaildocs', '0007_merge'),
        ('wagtailcore', '0040_page_draft_title'),
        ('snippets', '0010_communityresource_sharedcontent'),
        ('books', '0048_auto_20180405_1621'),
    ]

    operations = [
        migrations.CreateModel(
            name='BookCommunityResources',
            fields=[
                ('communityresource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='snippets.CommunityResource')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
            bases=('snippets.communityresource', models.Model),
        ),
        migrations.CreateModel(
            name='CommunityResources',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('link_external', models.URLField(blank=True, verbose_name='External link')),
                ('link_text', models.CharField(help_text='Call to Action Text', max_length=255)),
                ('link_document', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtaildocs.Document')),
                ('link_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page')),
                ('resource', models.ForeignKey(help_text='Manage resources through snippets.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='snippets.CommunityResource')),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='community_resources',
            field=wagtail.core.fields.StreamField((('content', books.models.SharedContentChooserBlock(snippets.models.SharedContent)), ('link', wagtail.core.blocks.URLBlock(required=False)), ('link_text', wagtail.core.blocks.CharBlock(required=False))), null=True),
        ),
        migrations.AddField(
            model_name='bookcommunityresources',
            name='book_community_resource',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='book_community_resources', to='books.Book'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('books', '0018_auto_20170624_1354'),
        ('members', '0004_membership_key_allowed'),
    ]

    operations = [
        migrations.CreateModel(
            name='KeyFee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField(default=datetime.date.today, help_text='The first day on which the membership is valid.')),
                ('end_date', models.DateField(default=datetime.date.today, help_text='The last day on which the membership is valid.')),
                ('sale_price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), help_text='The price at which this item sold.', max_digits=6)),
                ('ctrlid', models.CharField(default=members.models.next_keyfee_ctrlid, help_text="Payment processor's id for this line item if it was part of an online purchase.", max_length=40, unique=True)),
                ('protected', models.BooleanField(default=False, help_text='Protect against further auto processing by ETL, etc. Prevents overwrites of manually entered data.')),
            ],
            options={
                'abstract': False,
            },
            bases=(books.models.JournalLiner, models.Model),
        ),
        migrations.RemoveField(
            model_name='membership',
            name='key_allowed',
        ),
        migrations.AddField(
            model_name='keyfee',
            name='membership',
            field=models.OneToOneField(blank=True, default=None, help_text='The associated membership. MUST be specified, eventually!', null=True, on_delete=django.db.models.deletion.SET_NULL, to='members.Membership'),
        ),
        migrations.AddField(
            model_name='keyfee',
            name='sale',
            field=models.ForeignKey(blank=True, default=None, help_text='The sale that includes this line item.', null=True, on_delete=django.db.models.deletion.CASCADE, to='books.Sale'),
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('author', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=255)),
                ('genre', models.CharField(max_length=255)),
                ('year', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('price', models.FloatField()),
                ('image',
                 models.FileField(upload_to=books.models.book_img_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('seller',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('birthdate', models.DateField()),
                ('address', models.CharField(max_length=255)),
                ('balance', models.FloatField(default=0)),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to=books.models.user_img_path)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('email_confirmed', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='BookSale',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price_per_piece', models.FloatField()),
                ('quantity', models.IntegerField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('book',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.book')),
                ('buyer',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ISBN', models.CharField(max_length=13, unique=True)),
                ('title', models.CharField(max_length=30, verbose_name='도서명')),
                ('author',
                 models.CharField(blank=True, max_length=30,
                                  verbose_name='저자')),
                ('publisher',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='출판사')),
                ('intro', models.TextField(max_length=100, verbose_name='서평')),
                ('status',
                 models.CharField(choices=[('대여가능', '대여 가능'), ('예약', '예약 중'),
                                           ('대여중', '대여 중'),
                                           ('대여불가능', '대여 불가능')],
                                  default='대여가능',
                                  max_length=10,
                                  verbose_name='상태')),
                ('bookcover',
                 imagekit.models.fields.ProcessedImageField(
                     blank=True, upload_to=books.models.file_path)),
                ('stored_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-stored_at'],
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('book',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to='books.book')),
                ('comment', models.TextField(max_length=100,
                                             verbose_name='리뷰')),
                ('rate',
                 models.IntegerField(
                     default=1,
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(5)
                     ],
                     verbose_name='별점')),
            ],
        ),
    ]
Пример #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Novel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=20, verbose_name='名称')),
                ('number',
                 models.IntegerField(default=books.models.num,
                                     verbose_name='编号')),
            ],
        ),
        migrations.CreateModel(
            name='NovelTag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('tag', models.CharField(max_length=60, verbose_name='标签')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('mail', models.CharField(max_length=50, verbose_name='邮箱')),
            ],
        ),
        migrations.CreateModel(
            name='UserToSc',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('number',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Novel')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.User')),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='number',
            field=models.ManyToManyField(through='books.UserToSc',
                                         to='books.Novel',
                                         verbose_name='num1'),
        ),
        migrations.CreateModel(
            name='NumToTag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('num',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Novel')),
                ('tags',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.NovelTag')),
            ],
        ),
        migrations.AddField(
            model_name='noveltag',
            name='number',
            field=models.ManyToManyField(through='books.NumToTag',
                                         to='books.Novel',
                                         verbose_name='num'),
        ),
        migrations.CreateModel(
            name='NovelMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('author', models.CharField(max_length=30, verbose_name='作者')),
                ('introduce',
                 models.CharField(max_length=999, verbose_name='介绍')),
                ('up',
                 models.IntegerField(default=books.models.up_num,
                                     verbose_name='点赞')),
                ('serialize',
                 models.BooleanField(default=1, verbose_name='连载状态')),
                ('vip_type',
                 models.BooleanField(default=0, verbose_name='VIP可阅读')),
                ('cover',
                 models.ImageField(null=True,
                                   upload_to='cover',
                                   verbose_name='封面')),
                ('novel_num',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to='books.Novel',
                     verbose_name='小说编号')),
            ],
            options={
                'ordering': ['-up'],
            },
        ),
        migrations.AddField(
            model_name='novel',
            name='mail',
            field=models.ManyToManyField(through='books.UserToSc',
                                         to='books.User'),
        ),
        migrations.AddField(
            model_name='novel',
            name='tag',
            field=models.ManyToManyField(through='books.NumToTag',
                                         to='books.NovelTag'),
        ),
        migrations.CreateModel(
            name='Chapter',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('chapter',
                 models.CharField(max_length=100, verbose_name='小说章节')),
                ('content', models.TextField(verbose_name='单章内容')),
                ('topic',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Novel')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    replaces = [('books', '0001_initial'),
                ('books', '0002_auto_20160218_1121'),
                ('books', '0003_auto_20160222_1200'),
                ('books', '0004_auto_20160222_1230'),
                ('books', '0005_auto_20160224_1637'),
                ('books', '0006_auto_20160225_1410'),
                ('books', '0007_auto_20160229_1326'),
                ('books', '0008_book_concept_coach_link'),
                ('books', '0009_auto_20160307_1106'),
                ('books', '0010_auto_20160309_1016'),
                ('books', '0011_book_table_of_contents'),
                ('books', '0012_book_student_handbook'),
                ('books', '0013_auto_20160316_1555'),
                ('books', '0014_book_errata_link'),
                ('books', '0015_auto_20160328_1056'),
                ('books', '0016_book_license_text'),
                ('books', '0017_auto_20160407_1154'),
                ('books', '0018_book_ibook_link_volume_2'),
                ('books', '0019_auto_20160419_0955'),
                ('books', '0020_auto_20160421_2139'),
                ('books', '0021_auto_20160531_1045'),
                ('books', '0022_auto_20160617_1216'),
                ('books', '0023_auto_20160622_1556'),
                ('books', '0024_book_authors'),
                ('books', '0025_auto_20160719_1359'),
                ('books', '0026_auto_20160815_1159'),
                ('books', '0027_auto_20160901_1548'),
                ('books', '0028_book_coming_soon'),
                ('books', '0029_auto_20161025_1300'),
                ('books', '0030_auto_20161026_1541'),
                ('books', '0031_auto_20170330_0831'),
                ('books', '0032_book_comp_copy_available'),
                ('books', '0033_auto_20170414_0856'),
                ('books', '0034_book_tutor_marketing_book'),
                ('books', '0035_auto_20170706_2239'),
                ('books', '0036_auto_20170707_1305'),
                ('books', '0037_book_kindle_link'),
                ('books', '0038_auto_20180125_1347'),
                ('books', '0039_auto_20180301_1107'),
                ('books', '0040_auto_20180402_1158'),
                ('books', '0041_auto_20180403_1123'),
                ('books', '0042_auto_20180403_1132'),
                ('books', '0043_auto_20180405_1413'),
                ('books', '0044_auto_20180405_1452'),
                ('books', '0045_auto_20180405_1454'),
                ('books', '0046_auto_20180405_1459'),
                ('books', '0047_auto_20180405_1531'),
                ('books', '0048_auto_20180405_1621'),
                ('books', '0049_auto_20180406_0959'),
                ('books', '0050_auto_20180406_1002'),
                ('books', '0051_bookcommunityresources'),
                ('books', '0052_auto_20180406_1005'),
                ('books', '0053_auto_20180409_1242'),
                ('books', '0054_auto_20180418_1034'),
                ('books', '0055_auto_20180502_1255'),
                ('books', '0056_auto_20180711_0921'),
                ('books', '0057_auto_20180713_1227'),
                ('books', '0058_remove_book_subject'),
                ('books', '0059_book_subject'),
                ('books', '0060_auto_20180920_1155'),
                ('books', '0061_book_chegg_link'),
                ('books', '0062_book_chegg_link_text'),
                ('books', '0063_auto_20190220_0836'),
                ('books', '0064_remove_book_subject'),
                ('books', '0065_book_book_cover_text_color'),
                ('books', '0066_auto_20190515_1206'),
                ('books', '0067_auto_20190710_1351'),
                ('books', '0068_auto_20190710_1356'),
                ('books', '0069_auto_20190710_1358'),
                ('books', '0070_auto_20190710_1424'),
                ('books', '0071_auto_20190710_1504'),
                ('books', '0072_book_webview_rex_link'),
                ('books', '0073_auto_20190730_1437'),
                ('books', '0073_auto_20190730_1153'),
                ('books', '0074_merge_20190805_1353'),
                ('books', '0075_book_study_edge_link'),
                ('books', '0076_auto_20190805_1642'),
                ('books', '0077_auto_20190806_1342'),
                ('books', '0078_auto_20190916_1211'),
                ('books', '0079_remove_book_table_of_contents'),
                ('books', '0079_auto_20191003_1236'),
                ('books', '0080_merge_20191003_1238'),
                ('books', '0081_book_table_of_contents'),
                ('books', '0082_book_videos'),
                ('books', '0083_auto_20191113_1616'),
                ('books', '0084_auto_20200210_1041'),
                ('books', '0084_auto_20200203_1638'),
                ('books', '0085_merge_20200210_1046'),
                ('books', '0086_auto_20200211_0906'),
                ('books', '0087_book_partner_page_link_text'),
                ('books', '0088_auto_20200309_1624'),
                ('books', '0089_auto_20200309_1627'),
                ('books', '0090_auto_20200310_1016'),
                ('books', '0092_auto_20200403_1514'),
                ('books', '0084_auto_20200213_1156'),
                ('books', '0087_merge_20200213_1202'),
                ('books', '0088_merge_20200311_0956'),
                ('books', '0091_merge_20200325_0813'),
                ('books', '0093_merge_20200403_1547'),
                ('books', '0094_auto_20200415_1139'),
                ('books', '0095_book_use_alt_errata_schedule'),
                ('books', '0096_auto_20200511_1312'),
                ('books', '0097_facultyresources_k12'),
                ('books', '0098_auto_20200710_0830'),
                ('books', '0099_auto_20200710_0936'),
                ('books', '0100_videofacultyresources')]

    dependencies = [
        ('wagtaildocs', '0010_document_file_hash'),
        ('wagtailcore', '0040_page_draft_title'),
        ('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
        ('snippets', '0002_communityresource'),
        ('snippets', '0001_initial'),
        ('allies', '0001_initial'),
        ('wagtailimages', '0020_add-verbose-name'),
        ('wagtaildocs', '0007_merge'),
        ('snippets', '__first__'),
        ('wagtailimages', '0010_change_on_delete_behaviour'),
        ('snippets', '0010_communityresource_sharedcontent'),
        ('wagtaildocs', '0004_capitalizeverbose'),
    ]

    operations = [
        migrations.CreateModel(
            name='BookAlly',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('book_link_url',
                 models.URLField(blank=True, help_text='Call to Action Link')),
                ('book_link_text',
                 models.CharField(help_text='Call to Action Text',
                                  max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='BookIndex',
            fields=[
                ('page_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailcore.Page')),
                ('page_description', models.TextField()),
                ('dev_standards_heading',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('dev_standard_1_heading',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('dev_standard_1_description',
                 wagtail.core.fields.RichTextField()),
                ('dev_standard_2_heading',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('dev_standard_2_description',
                 wagtail.core.fields.RichTextField()),
                ('dev_standard_3_heading',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('dev_standard_3_description',
                 wagtail.core.fields.RichTextField()),
                ('subject_list_heading',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('promote_image',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.Image')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page', ),
        ),
        migrations.CreateModel(
            name='FacultyResources',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('link_external',
                 models.URLField(
                     blank=True,
                     help_text=
                     'Provide an external URL starting with http:// (or fill out either one of the following two).',
                     verbose_name='External link')),
                ('link_document',
                 models.ForeignKey(
                     blank=True,
                     help_text='Or select a document for viewers to download.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('link_page',
                 models.ForeignKey(
                     blank=True,
                     help_text='Or select an existing page to attach.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailcore.Page')),
                ('resource',
                 models.ForeignKey(
                     help_text='Manage resources through snippets.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='snippets.FacultyResource')),
                ('link_text',
                 models.CharField(default='',
                                  help_text='Call to Action Text',
                                  max_length=255)),
                ('coming_soon_text',
                 models.CharField(
                     blank=True,
                     help_text=
                     'If there is text in this field a coming soon banner will be added with this description.',
                     max_length=255,
                     null=True)),
                ('updated',
                 models.DateTimeField(
                     blank=True,
                     help_text='Late date resource was updated',
                     null=True)),
                ('featured',
                 models.BooleanField(
                     default=False,
                     help_text='Add to featured bar on resource page')),
                ('k12',
                 models.BooleanField(default=False,
                                     help_text='Add K12 banner to resource')),
                ('video_reference_number',
                 models.IntegerField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Quotes',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('quote_text', wagtail.core.fields.RichTextField()),
                ('quote_author', models.CharField(max_length=255)),
                ('quote_author_school', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('page_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailcore.Page')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('cnx_id',
                 models.CharField(
                     blank=True,
                     help_text=
                     'This is used to pull relevant information from CNX.',
                     max_length=255,
                     null=True)),
                ('updated',
                 models.DateTimeField(
                     blank=True,
                     help_text='Late date web content was updated',
                     null=True)),
                ('description',
                 wagtail.core.fields.RichTextField(
                     blank=True,
                     help_text='Description shown on Book Detail page.')),
                ('publish_date',
                 models.DateField(help_text='Date the book is published on.',
                                  null=True)),
                ('print_isbn_10',
                 models.CharField(
                     blank=True,
                     help_text='ISBN 10 for print version (hardcover).',
                     max_length=255,
                     null=True)),
                ('print_isbn_13',
                 models.CharField(
                     blank=True,
                     help_text='ISBN 13 for print version (hardcover).',
                     max_length=255,
                     null=True)),
                ('license_name',
                 models.CharField(blank=True,
                                  editable=False,
                                  help_text='Name of the license.',
                                  max_length=255,
                                  null=True)),
                ('license_version',
                 models.CharField(blank=True,
                                  editable=False,
                                  help_text='Version of the license.',
                                  max_length=255,
                                  null=True)),
                ('license_url',
                 models.CharField(blank=True,
                                  editable=False,
                                  help_text='External URL of the license.',
                                  max_length=255,
                                  null=True)),
                ('cover',
                 models.ForeignKey(
                     help_text='The book cover to be shown on the website.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('is_ap',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Whether this book is an AP (Advanced Placement) book.')),
                ('high_resolution_pdf',
                 models.ForeignKey(
                     blank=True,
                     help_text='High quality PDF document of the book.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('ibook_link',
                 models.URLField(blank=True, help_text='Link to iBook')),
                ('low_resolution_pdf',
                 models.ForeignKey(
                     blank=True,
                     help_text='Low quality PDF document of the book.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('webview_link',
                 models.URLField(blank=True,
                                 help_text='Link to CNX Webview book')),
                ('amazon_link',
                 models.URLField(blank=True, help_text='Link to Amazon')),
                ('bookshare_link',
                 models.URLField(blank=True,
                                 help_text='Link to Bookshare resources')),
                ('license_text',
                 models.TextField(blank=True,
                                  help_text='Overrides default license text.',
                                  null=True)),
                ('ibook_link_volume_2',
                 models.URLField(blank=True,
                                 help_text='Link to secondary iBook')),
                ('community_resource_cta',
                 models.CharField(blank=True,
                                  help_text='Call the action text.',
                                  max_length=255,
                                  null=True)),
                ('community_resource_url',
                 models.URLField(blank=True,
                                 help_text='URL of the external source.')),
                ('authors',
                 wagtail.core.fields.StreamField([
                     ('author',
                      wagtail.core.blocks.StructBlock([
                          ('name',
                           wagtail.core.blocks.CharBlock(
                               help_text='Full name of the author.',
                               required=True)),
                          ('university',
                           wagtail.core.blocks.CharBlock(
                               help_text=
                               'Name of the university/institution the author is associated with.',
                               required=False)),
                          ('country',
                           wagtail.core.blocks.CharBlock(
                               help_text=
                               'Country of the university/institution.',
                               required=False)),
                          ('senior_author',
                           wagtail.core.blocks.BooleanBlock(
                               help_text=
                               'Whether the author is a senior author. (Senior authors are shown before non-senior authors.)',
                               required=False)),
                          ('display_at_top',
                           wagtail.core.blocks.BooleanBlock(
                               help_text='Whether display the author on top.',
                               required=False))
                      ]))
                 ],
                                                 null=True)),
                ('coming_soon', models.BooleanField(default=False)),
                ('salesforce_abbreviation',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('salesforce_name',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('amazon_coming_soon',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Whether this book is coming to Amazon bookstore.')),
                ('bookstore_coming_soon',
                 models.BooleanField(
                     default=False,
                     help_text='Whether this book is coming to bookstore soon.'
                 )),
                ('comp_copy_available',
                 models.BooleanField(
                     default=True,
                     help_text='Whether free compy available for teachers.')),
                ('tutor_marketing_book',
                 models.BooleanField(
                     default=False,
                     help_text='Whether this is a Tutor marketing book.')),
                ('digital_isbn_10',
                 models.CharField(blank=True,
                                  help_text='ISBN 10 for digital version.',
                                  max_length=255,
                                  null=True)),
                ('digital_isbn_13',
                 models.CharField(blank=True,
                                  help_text='ISBN 13 for digital version.',
                                  max_length=255,
                                  null=True)),
                ('ibook_isbn_10',
                 models.CharField(blank=True,
                                  help_text='ISBN 10 for iBook version.',
                                  max_length=255,
                                  null=True)),
                ('ibook_isbn_13',
                 models.CharField(blank=True,
                                  help_text='ISBN 13 for iBook version.',
                                  max_length=255,
                                  null=True)),
                ('ibook_volume_2_isbn_10',
                 models.CharField(blank=True,
                                  help_text='ISBN 10 for iBook v2 version.',
                                  max_length=255,
                                  null=True)),
                ('ibook_volume_2_isbn_13',
                 models.CharField(blank=True,
                                  help_text='ISBN 13 for iBook v2 version.',
                                  max_length=255,
                                  null=True)),
                ('kindle_link',
                 models.URLField(blank=True,
                                 help_text='Link to Kindle version')),
                ('community_resource_blurb',
                 models.TextField(blank=True, help_text='Blurb.')),
                ('community_resource_feature_text',
                 models.TextField(
                     blank=True,
                     help_text='Text of the community resource feature.')),
                ('cover_color',
                 models.CharField(choices=[('blue', 'Blue'),
                                           ('deep-green', 'Deep Green'),
                                           ('gold', 'Gold'), ('gray', 'Gray'),
                                           ('green', 'Green'),
                                           ('light-blue', 'Light Blue'),
                                           ('light-gray', 'Light Gray'),
                                           ('medium-blue', 'Medium Blue'),
                                           ('orange', 'Orange'),
                                           ('red', 'Red'),
                                           ('yellow', 'Yellow')],
                                  default='blue',
                                  help_text='The color of the cover.',
                                  max_length=255)),
                ('reverse_gradient', models.BooleanField(default=False)),
                ('title_image',
                 models.ForeignKey(
                     help_text=
                     'The svg for title image to be shown on the website.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('community_resource_feature_link',
                 models.ForeignKey(
                     blank=True,
                     help_text='Document of the community resource feature.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('ally_content',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     null=True)),
                ('bookstore_content',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     help_text='Bookstore content.',
                     null=True)),
                ('comp_copy_content',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     help_text='Content of the free copy.',
                     null=True)),
                ('errata_content',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     help_text='Errata content.',
                     null=True)),
                ('free_stuff_instructor',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     help_text=
                     'Snippet to show texts for free instructor resources.',
                     null=True)),
                ('free_stuff_student',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     help_text=
                     'Snipped to show texts for free student resources.',
                     null=True)),
                ('webinar_content',
                 wagtail.core.fields.StreamField(
                     [('content',
                       books.models.SharedContentChooserBlock(
                           snippets.models.SharedContent)),
                      ('link', wagtail.core.blocks.URLBlock(required=False)),
                      ('link_text',
                       wagtail.core.blocks.CharBlock(required=False))],
                     blank=True,
                     null=True)),
                ('community_resource_heading',
                 models.CharField(
                     blank=True,
                     help_text='Snipped to show texts for community resources.',
                     max_length=255,
                     null=True)),
                ('community_resource_logo',
                 models.ForeignKey(
                     blank=True,
                     help_text='Logo for community resources.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('book_state',
                 models.CharField(choices=[
                     ('live', 'Live'), ('coming_soon', 'Coming Soon'),
                     ('new_edition_available',
                      'New Edition Available (Show new edition correction schedule)'
                      ),
                     ('deprecated',
                      'Deprecated (Disallow errata submissions and show deprecated schedule)'
                      ), ('retired', 'Retired (Remove from website)')
                 ],
                                  default='live',
                                  help_text='The state of the book.',
                                  max_length=255)),
                ('promote_image',
                 models.ForeignKey(
                     blank=True,
                     help_text='Promote image.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.Image')),
                ('chegg_link',
                 models.URLField(blank=True,
                                 help_text='Link to Chegg e-reader',
                                 null=True)),
                ('chegg_link_text',
                 models.CharField(blank=True,
                                  help_text='Text for Chegg link.',
                                  max_length=255,
                                  null=True)),
                ('book_cover_text_color',
                 models.CharField(
                     choices=[
                         ('yellow', 'Yellow'), ('light_blue', 'Light Blue'),
                         ('dark_blue', 'Dark Blue'), ('green', 'Green'),
                         ('white', 'White'), ('grey', 'Grey'), ('red', 'Red'),
                         ('white_red', 'White/Red'),
                         ('white_blue', 'White/Blue'),
                         ('green_white', 'Green/White'),
                         ('yellow_white', 'Yellow/White'),
                         ('grey_white', 'Grey/White'),
                         ('white_grey', 'White/Grey'),
                         ('white_orange', 'White/Orange')
                     ],
                     default='yellow',
                     help_text=
                     'Use by the Unified team - this will not change the text color on the book cover.',
                     max_length=255)),
                ('webview_rex_link',
                 models.URLField(blank=True,
                                 help_text='Link to REX Webview book')),
                ('print_softcover_isbn_10',
                 models.CharField(
                     blank=True,
                     help_text='ISBN 10 for print version (softcover).',
                     max_length=255,
                     null=True)),
                ('print_softcover_isbn_13',
                 models.CharField(
                     blank=True,
                     help_text='ISBN 13 for print version (softcover).',
                     max_length=255,
                     null=True)),
                ('last_updated_pdf',
                 models.DateTimeField(
                     blank=True,
                     help_text='Last time PDF was revised.',
                     null=True,
                     verbose_name='PDF Content Revision Date')),
                ('enable_study_edge',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'This will cause the link to the Study Edge app appear on the book details page.'
                 )),
                ('rex_callout_blurb',
                 models.CharField(
                     blank=True,
                     help_text='Additional text for the REX callout.',
                     max_length=255,
                     null=True)),
                ('rex_callout_title',
                 models.CharField(blank=True,
                                  default='Recommended',
                                  help_text='Title of the REX callout',
                                  max_length=255,
                                  null=True)),
                ('table_of_contents',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     blank=True, editable=False, help_text='TOC.', null=True)),
                ('videos',
                 wagtail.core.fields.StreamField(
                     [('video',
                       wagtail.core.blocks.ListBlock(
                           wagtail.core.blocks.StructBlock([
                               ('title', wagtail.core.blocks.CharBlock()),
                               ('description',
                                wagtail.core.blocks.RichTextBlock()),
                               ('embed', wagtail.core.blocks.RawHTMLBlock())
                           ])))],
                     blank=True,
                     null=True)),
                ('partner_list_label',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Controls the heading text on the book detail page for partners. This will update ALL books to use this value!',
                     max_length=255,
                     null=True)),
                ('partner_page_link_text',
                 models.CharField(
                     blank=True,
                     help_text='Link to partners page on top right of list.',
                     max_length=255,
                     null=True)),
                ('featured_resources_header',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Featured resource header on instructor resources tab.',
                     max_length=255,
                     null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page', ),
        ),
        migrations.CreateModel(
            name='Authors',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(help_text='Full name of the author.',
                                  max_length=255)),
                ('university',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Name of the university/institution the author is associated with.',
                     max_length=255,
                     null=True)),
                ('country',
                 models.CharField(
                     blank=True,
                     help_text='Country of the university/institution.',
                     max_length=255,
                     null=True)),
                ('senior_author',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Whether the author is a senior author. (Senior authors are shown before non-senior authors.)'
                 )),
                ('display_at_top',
                 models.BooleanField(
                     default=False,
                     help_text='Whether display the author on top.')),
                ('book',
                 modelcluster.fields.ParentalKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_contributing_authors',
                     to='books.Book')),
            ],
        ),
        migrations.CreateModel(
            name='BookQuotes',
            fields=[
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('books.quotes', models.Model),
        ),
        migrations.CreateModel(
            name='BookFacultyResources',
            fields=[
                ('facultyresources_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='books.FacultyResources')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('book_faculty_resource',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_faculty_resources',
                     to='books.Book')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('books.facultyresources', models.Model),
        ),
        migrations.CreateModel(
            name='BookAllies',
            fields=[
                ('bookally_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='books.BookAlly')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('book_ally',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_allies',
                     to='books.Book')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('books.bookally', models.Model),
        ),
        migrations.CreateModel(
            name='StudentResources',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('link_external',
                 models.URLField(
                     blank=True,
                     help_text=
                     'Provide an external URL starting with http:// (or fill out either one of the following two).',
                     verbose_name='External link')),
                ('link_text',
                 models.CharField(help_text='Call to Action Text',
                                  max_length=255)),
                ('link_document',
                 models.ForeignKey(
                     blank=True,
                     help_text='Or select a document for viewers to download.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtaildocs.Document')),
                ('link_page',
                 models.ForeignKey(
                     blank=True,
                     help_text='Or select an existing page to attach.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailcore.Page')),
                ('resource',
                 models.ForeignKey(
                     help_text='Manage resources through snippets.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='snippets.StudentResource')),
                ('coming_soon_text',
                 models.CharField(
                     blank=True,
                     help_text=
                     'If there is text in this field a coming soon banner will be added with this description.',
                     max_length=255,
                     null=True)),
                ('updated',
                 models.DateTimeField(
                     blank=True,
                     help_text='Late date resource was updated',
                     null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookStudentResources',
            fields=[
                ('studentresources_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='books.StudentResources')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('book_student_resource',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_student_resources',
                     to='books.Book')),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
            bases=('books.studentresources', models.Model),
        ),
        migrations.CreateModel(
            name='BookSharedContent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('link', models.URLField(blank=True, null=True)),
                ('link_text',
                 models.CharField(blank=True, max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='BookSharedContents',
            fields=[
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
            bases=('books.booksharedcontent', models.Model),
        ),
        migrations.DeleteModel(name='BookSharedContent', ),
        migrations.DeleteModel(name='BookSharedContents', ),
        migrations.DeleteModel(name='BookQuotes', ),
        migrations.DeleteModel(name='Quotes', ),
        migrations.CreateModel(
            name='SubjectBooks',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('subject',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='subjects_subject',
                     to='snippets.Subject')),
            ],
        ),
        migrations.CreateModel(
            name='BookSubjects',
            fields=[
                ('subjectbooks_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='books.SubjectBooks')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('book_subject',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_subjects',
                     to='books.Book')),
            ],
            options={
                'abstract': False,
                'ordering': ['sort_order'],
            },
            bases=('books.subjectbooks', models.Model),
        ),
        migrations.DeleteModel(name='BookAllies', ),
        migrations.DeleteModel(name='BookAlly', ),
        migrations.CreateModel(
            name='VideoFacultyResource',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('resource_heading', models.CharField(max_length=255)),
                ('resource_description',
                 wagtail.core.fields.RichTextField(blank=True, null=True)),
                ('video_title',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('video_url', models.URLField(blank=True, null=True)),
                ('video_file',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to='resource_videos')),
            ],
        ),
        migrations.CreateModel(
            name='VideoFacultyResources',
            fields=[
                ('videofacultyresource_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='books.VideoFacultyResource')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('book_video_faculty_resource',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='book_video_faculty_resources',
                     to='books.Book')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('books.videofacultyresource', models.Model),
        ),
    ]
Пример #7
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DiscoveryMethod',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     help_text=
                     'The name of some means by which people learn about our organization.',
                     max_length=30,
                     unique=True)),
                ('order',
                 models.IntegerField(
                     default=None,
                     help_text=
                     'These values define the order in which the discovery methods should be presented to users.',
                     unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='GroupMembership',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_date',
                 models.DateField(
                     default=datetime.date.today,
                     help_text='The first day on which the membership is valid.'
                 )),
                ('end_date',
                 models.DateField(
                     default=datetime.date.today,
                     help_text='The last day on which the membership is valid.'
                 )),
                ('sale_price',
                 models.DecimalField(
                     decimal_places=2,
                     default=Decimal('0'),
                     help_text='The price at which this item sold.',
                     max_digits=6)),
                ('max_members',
                 models.IntegerField(
                     blank=True,
                     default=None,
                     help_text=
                     'The maximum number of members to which this group membership can be applied. Blank if no limit.',
                     null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=(books.models.JournalLiner, models.Model),
        ),
        migrations.CreateModel(
            name='Member',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nag_re_membership',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'If true, person will be nudged (via email) to renew membership.'
                 )),
                ('membership_card_md5',
                 models.CharField(
                     blank=True,
                     help_text=
                     'MD5 of the member card#. Field will auto-apply MD5 if value is digits.',
                     max_length=32,
                     null=True)),
                ('membership_card_when',
                 models.DateTimeField(
                     blank=True,
                     help_text=
                     'Date/time on which the membership card was created.',
                     null=True)),
                ('auth_user',
                 models.OneToOneField(
                     help_text=
                     'This must point to the corresponding auth.User object.',
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='member',
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['auth_user__first_name', 'auth_user__last_name'],
            },
        ),
        migrations.CreateModel(
            name='MemberLogin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('when',
                 models.DateTimeField(
                     default=django.utils.timezone.now,
                     help_text='Date/time member logged in.')),
                ('ip',
                 models.GenericIPAddressField(
                     help_text='IP address from which member logged in.')),
                ('member',
                 models.ForeignKey(
                     blank=True,
                     help_text='The member who logged in.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='members.Member')),
            ],
            options={
                'verbose_name': 'Login',
            },
        ),
        migrations.CreateModel(
            name='MemberNote',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content',
                 models.TextField(
                     help_text=
                     'For staff. Anything you want to say about the member.',
                     max_length=2048)),
                ('author',
                 models.ForeignKey(
                     blank=True,
                     help_text='The member who wrote this note.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='member_notes_authored',
                     to='members.Member')),
                ('member',
                 models.ForeignKey(
                     help_text='The member to which this note pertains.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='members.Member')),
            ],
        ),
        migrations.CreateModel(
            name='Membership',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('start_date',
                 models.DateField(
                     default=datetime.date.today,
                     help_text='The first day on which the membership is valid.'
                 )),
                ('end_date',
                 models.DateField(
                     default=datetime.date.today,
                     help_text='The last day on which the membership is valid.'
                 )),
                ('sale_price',
                 models.DecimalField(
                     decimal_places=2,
                     default=Decimal('0'),
                     help_text='The price at which this item sold.',
                     max_digits=6)),
                ('membership_type',
                 models.CharField(choices=[('R', 'Regular'),
                                           ('W', 'Work-Trade'),
                                           ('S', 'Scholarship'),
                                           ('C', 'Complimentary'),
                                           ('G', 'Group'), ('F', 'Family'),
                                           ('K', 'Gift Card')],
                                  default='R',
                                  help_text='The type of membership.',
                                  max_length=1)),
                ('ctrlid',
                 models.CharField(
                     default=members.models.next_membership_ctrlid,
                     help_text=
                     "Payment processor's id for this membership if it was part of an online purchase.",
                     max_length=40,
                     unique=True)),
                ('protected',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Protect against further auto processing by ETL, etc. Prevents overwrites of manually entered data.'
                 )),
                ('when_nudged',
                 models.DateField(
                     blank=True,
                     default=None,
                     help_text=
                     'Most recent date on which a renewal reminder was sent.',
                     null=True)),
                ('nudge_count',
                 models.IntegerField(
                     default=0,
                     help_text=
                     'The number of times a renewal reminder was sent.')),
                ('group',
                 models.ForeignKey(
                     blank=True,
                     default=None,
                     help_text=
                     'The associated group membership, if any. Usually none.',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='members.GroupMembership')),
                ('member',
                 models.ForeignKey(
                     blank=True,
                     default=None,
                     help_text='The member to whom this membership applies.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='members.Member')),
            ],
            options={
                'ordering': ['start_date'],
            },
            bases=(books.models.JournalLiner, models.Model),
        ),
        migrations.CreateModel(
            name='MembershipGiftCard',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('redemption_code',
                 models.CharField(
                     help_text=
                     'A random string printed on the card, used during card redemption / membership activation.',
                     max_length=20,
                     unique=True)),
                ('date_created',
                 models.DateField(
                     default=django.utils.timezone.now,
                     help_text='The date on which the gift card was created.')
                 ),
                ('price',
                 models.DecimalField(
                     decimal_places=2,
                     help_text='The price to buy this gift card.',
                     max_digits=6)),
                ('month_duration',
                 models.IntegerField(
                     blank=True,
                     default=None,
                     help_text=
                     'The number of months of membership this gift card grants when redeemed.',
                     null=True,
                     verbose_name='Months')),
                ('day_duration',
                 models.IntegerField(
                     blank=True,
                     default=None,
                     help_text=
                     'The number of days of membership this gift card grants when redeemed.',
                     null=True,
                     verbose_name='Days')),
            ],
            options={
                'verbose_name': 'Gift card',
            },
        ),
        migrations.CreateModel(
            name='MembershipGiftCardRedemption',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('redemption_date',
                 models.DateField(
                     default=django.utils.timezone.now,
                     help_text='The date on which the gift card was redeemed.')
                 ),
                ('card',
                 models.OneToOneField(
                     help_text='The membership gift card that was redeemed.',
                     on_delete=django.db.models.deletion.PROTECT,
                     to='members.MembershipGiftCard')),
            ],
            options={
                'verbose_name': 'Gift card redemption',
            },
        ),
        migrations.CreateModel(
            name='MembershipGiftCardReference',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sale_price',
                 models.DecimalField(
                     decimal_places=2,
                     help_text='The price at which this item sold.',
                     max_digits=6)),
                ('ctrlid',
                 models.CharField(
                     default=members.models.next_giftcardref_ctrlid,
                     help_text=
                     "Payment processor's id if this was part of an online purchase.",
                     max_length=40,
                     unique=True)),
                ('protected',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Protect against further auto processing by ETL, etc. Prevents overwrites of manually entered data.'
                 )),
                ('card',
                 models.OneToOneField(
                     blank=True,
                     help_text='The membership gift card being sold.',
                     null=True,
                     on_delete=django.db.models.deletion.PROTECT,
                     to='members.MembershipGiftCard')),
                ('sale',
                 models.ForeignKey(
                     blank=True,
                     help_text=
                     'The sale that includes the card as a line item.',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='books.Sale')),
            ],
            options={
                'verbose_name': 'Membership gift card',
            },
            bases=(models.Model, books.models.JournalLiner),
        ),
        migrations.CreateModel(
            name='Pushover',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('key',
                 models.CharField(
                     help_text="The member's User Key on Pushover.com",
                     max_length=30)),
                ('who',
                 models.ForeignKey(
                     help_text='The member to whom this tagging info applies.',
                     on_delete=django.db.models.deletion.CASCADE,
                     to='members.Member')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(help_text='A short name for the tag.',
                                  max_length=40,
                                  unique=True)),
                ('meaning',
                 models.TextField(
                     help_text=
                     "A discussion of the tag's semantics. What does it mean? What does it NOT mean?",
                     max_length=500)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Tagging',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_tagged',
                 models.DateTimeField(
                     auto_now_add=True,
                     help_text='Date/time on which the member was tagged.')),
                ('can_tag',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'If True, the tagged member can be a authorizing member for this tag.'
                 )),
                ('authorizing_member',
                 models.ForeignKey(
                     blank=True,
                     help_text=
                     'The member that authorized that the member be tagged.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='authorized_taggings',
                     to='members.Member')),
                ('tag',
                 models.ForeignKey(help_text='The tag assigned to the member.',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='members.Tag')),
                ('tagged_member',
                 models.ForeignKey(help_text='The member tagged.',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='taggings',
                                   to='members.Member')),
            ],
        ),
        migrations.CreateModel(
            name='VisitEvent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('when',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      help_text='Date/time of visit event.')),
                ('method',
                 models.CharField(
                     choices=[('R', 'RFID'), ('F', 'Front Desk'),
                              ('M', 'Mobile App'), ('U', 'Unknown')],
                     default='U',
                     help_text=
                     "The method used to record the visit, such as 'Front Desk' or 'RFID'.",
                     max_length=1)),
                ('event_type',
                 models.CharField(choices=[('A', 'Arrival'), ('P', 'Presence'),
                                           ('D', 'Departure')],
                                  help_text='The type of visit event.',
                                  max_length=1)),
                ('sync1',
                 models.BooleanField(
                     default=False,
                     help_text=
                     "True if this event has been sync'ed to 'other system #1'"
                 )),
                ('who',
                 models.ForeignKey(
                     help_text="The member who's visiting or visited.",
                     on_delete=django.db.models.deletion.PROTECT,
                     to='members.Member')),
            ],
            options={
                'ordering': ['when'],
            },
        ),
        migrations.CreateModel(
            name='WifiMacDetected',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('when',
                 models.DateTimeField(
                     default=django.utils.timezone.now,
                     help_text='Date/time when MAC was noticed to be present.')
                 ),
                ('mac',
                 models.CharField(help_text='A MAC address as 12 hex digits.',
                                  max_length=12)),
            ],
            options={
                'verbose_name_plural': 'Wifi MACs detected',
                'verbose_name': 'Wifi MAC detected',
            },
        ),
        migrations.AddField(
            model_name='membership',
            name='redemption',
            field=models.ForeignKey(
                blank=True,
                default=None,
                help_text=
                'The associated membership gift card redemption, if any. Usually none.',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='members.MembershipGiftCardRedemption'),
        ),
        migrations.AddField(
            model_name='membership',
            name='sale',
            field=models.ForeignKey(
                blank=True,
                default=None,
                help_text=
                "The sale that includes this line item, if any. E.g. comp memberships don't have a corresponding sale.",
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='books.Sale'),
        ),
        migrations.AddField(
            model_name='member',
            name='tags',
            field=models.ManyToManyField(blank=True,
                                         related_name='members',
                                         through='members.Tagging',
                                         to='members.Tag'),
        ),
        migrations.AddField(
            model_name='groupmembership',
            name='group_tag',
            field=models.ForeignKey(
                help_text=
                'Group membership is initially populated with the set of people having this tag.',
                on_delete=django.db.models.deletion.PROTECT,
                to='members.Tag'),
        ),
        migrations.AddField(
            model_name='groupmembership',
            name='invoice',
            field=models.ForeignKey(
                blank=True,
                default=None,
                help_text=
                'The receivable invoice that includes this line item, if any.',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='books.ReceivableInvoice'),
        ),
        migrations.AddField(
            model_name='groupmembership',
            name='members_covered',
            field=models.ManyToManyField(through='members.Membership',
                                         to='members.Member'),
        ),
        migrations.AddField(
            model_name='groupmembership',
            name='sale',
            field=models.ForeignKey(
                blank=True,
                default=None,
                help_text=
                'The sale on which this group membership appears as a line item, if any.',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='books.Sale'),
        ),
        migrations.AlterUniqueTogether(
            name='visitevent',
            unique_together=set([('who', 'when')]),
        ),
        migrations.AlterUniqueTogether(
            name='tagging',
            unique_together=set([('tagged_member', 'tag')]),
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('author_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('isbn', models.CharField(max_length=120)),
                ('title', models.CharField(max_length=120)),
                ('description', models.TextField()),
                ('length',
                 models.DurationField(default=datetime.timedelta(0, 1200))),
                ('release_date', models.DateTimeField()),
                ('image', models.FileField(blank=True,
                                           null=True,
                                           upload_to=b'')),
                ('audio_link',
                 models.FileField(
                     upload_to=books.models.get_upload_file_name)),
                ('is_banner',
                 models.CharField(choices=[('On', 'on'), ('Off', 'off')],
                                  max_length=10)),
                ('is_featured',
                 models.CharField(choices=[('On', 'on'), ('Off', 'off')],
                                  max_length=10)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('author_id', models.ManyToManyField(to='books.Author')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category_name', models.CharField(max_length=50)),
                ('parent',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='child',
                                   to='books.Category')),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
            },
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('currency_name', models.CharField(max_length=255)),
                ('currency_symbol', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('group_name', models.CharField(max_length=120)),
            ],
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('language_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Narrator',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('narrator_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price_tag',
                 models.DecimalField(decimal_places=2,
                                     default=Decimal('0.00'),
                                     max_digits=6)),
                ('book',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Book')),
                ('currency',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='price_currency',
                                   to='books.Currency')),
                ('language',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Language')),
            ],
        ),
        migrations.CreateModel(
            name='ProgramFormat',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('program_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Publisher',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('publisher_name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rating', models.IntegerField(default=0)),
                ('book',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Book')),
                ('user_id',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('group',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='books.Group')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='book',
            name='category_id',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='books.Category'),
        ),
        migrations.AddField(
            model_name='book',
            name='narrator_id',
            field=models.ManyToManyField(to='books.Narrator'),
        ),
        migrations.AddField(
            model_name='book',
            name='program_format',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='books.ProgramFormat'),
        ),
        migrations.AddField(
            model_name='book',
            name='publisher',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='books.Publisher'),
        ),
    ]