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

    dependencies = [
        ('base', '0002_auto_20170130_1832'),
    ]

    operations = [
        migrations.AlterField(
            model_name='script',
            name='scriptFile',
            field=models.FileField(upload_to=base.models.script_file_path),
        ),
    ]
Ejemplo n.º 2
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('base', '0003_auto_20180422_0922'),
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('base_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='base.Base')),
                ('file_path', models.FileField(upload_to=base.models.get_upload_path)),
                ('file_related_parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='file_related_parent_name', to='base.Base')),
                ('file_related_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='file_related_user_name', to=settings.AUTH_USER_MODEL)),
            ],
            bases=('base.base',),
        ),
    ]
Ejemplo n.º 3
0
class Migration(migrations.Migration):

    dependencies = [
        ('base', '0003_fundingtype'),
    ]

    operations = [
        migrations.CreateModel(
            name='Partner',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('brand_name', models.CharField(max_length=255)),
                ('logo',
                 models.FileField(
                     upload_to=base.models.Partner.partner_logo_path)),
                ('created_at',
                 models.DateTimeField(auto_now_add=True,
                                      null=True,
                                      verbose_name='Creation date')),
                ('modified_at',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='Modification date')),
                ('status',
                 models.BooleanField(
                     default=True,
                     help_text="Partner's status in the system",
                     verbose_name='Status')),
            ],
            options={
                'verbose_name': 'Partner',
                'verbose_name_plural': 'Partners',
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('username_user', models.CharField(max_length=90)),
                ('image_profile',
                 models.ImageField(blank=True, null=True,
                                   upload_to='profile/')),
                ('image_sampul',
                 models.ImageField(blank=True, null=True,
                                   upload_to='sampul/')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('slug', models.SlugField(blank=True, null=True)),
                ('no_tlp',
                 models.IntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MaxValueValidator(3012)
                     ])),
                ('bio', models.TextField(blank=True, null=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', base.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Artikel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('judul', models.CharField(max_length=300)),
                ('slug', models.SlugField()),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('isi', models.TextField()),
                ('media', models.FileField(upload_to='File/')),
                ('likes',
                 models.ManyToManyField(related_name='likes',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='AuditEntry',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('action', models.CharField(max_length=64)),
                ('ip', models.GenericIPAddressField(null=True)),
                ('username', models.CharField(max_length=256, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tags',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField()),
                ('bio', models.CharField(blank=True, max_length=300,
                                         null=True)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='MessageModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('timestamp',
                 models.DateTimeField(auto_now_add=True,
                                      db_index=True,
                                      verbose_name='timestamp')),
                ('body', mirage.fields.EncryptedTextField()),
                ('recipient',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='to_user',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='recipient')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='from_user',
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='user')),
            ],
            options={
                'verbose_name': 'message',
                'verbose_name_plural': 'messages',
                'ordering': ('-timestamp', ),
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('content', models.TextField()),
                ('artikel',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='base.Artikel')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='artikel',
            name='tags',
            field=models.ManyToManyField(to='base.Tags'),
        ),
        migrations.AddField(
            model_name='artikel',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        ('base', '0002_auto_20210108_2049'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='coursematerial',
            name='content',
        ),
        migrations.RemoveField(
            model_name='coursematerial',
            name='document',
        ),
        migrations.RemoveField(
            model_name='coursematerial',
            name='video',
        ),
        migrations.AddField(
            model_name='coursematerial',
            name='description',
            field=wagtail.core.fields.RichTextField(blank=True,
                                                    verbose_name='Descrição'),
        ),
        migrations.AddField(
            model_name='coursematerial',
            name='link',
            field=models.URLField(blank=True,
                                  null=True,
                                  verbose_name='Broadcast link'),
        ),
        migrations.AlterField(
            model_name='coursematerial',
            name='date',
            field=models.DateField(blank=True, null=True, verbose_name='Data'),
        ),
        migrations.AlterField(
            model_name='coursepageitem',
            name='btn_form_01',
            field=models.CharField(blank=True,
                                   max_length=50,
                                   null=True,
                                   verbose_name='Texto do botão'),
        ),
        migrations.AlterField(
            model_name='coursepageitem',
            name='btn_form_02',
            field=models.CharField(blank=True,
                                   max_length=50,
                                   null=True,
                                   verbose_name='Texto do botão'),
        ),
        migrations.CreateModel(
            name='CourseMaterialVideo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('video',
                 models.FileField(blank=True,
                                  max_length=254,
                                  null=True,
                                  upload_to=base.models.course_directory_path,
                                  verbose_name='Vídeo')),
                ('course_material',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='course_material_video',
                     to='base.coursematerial')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CourseMaterialDocument',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('document',
                 models.FileField(blank=True,
                                  max_length=254,
                                  null=True,
                                  upload_to=base.models.course_directory_path,
                                  verbose_name='Documento')),
                ('course_material',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='course_material_document',
                     to='base.coursematerial')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
    ]
Ejemplo n.º 6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0052_pagelogentry'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wagtailstreamforms', '0002_form_site'),
        ('wagtailtrans', '0009_create_initial_language'),
        ('wagtailimages', '0022_uploadedimage'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=254,
                                          verbose_name='Nome')),
                ('start_date',
                 models.DateField(blank=True, null=True,
                                  verbose_name='Início')),
                ('end_date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Término')),
                ('start_time',
                 models.TimeField(blank=True, null=True,
                                  verbose_name='Início')),
                ('end_time',
                 models.TimeField(blank=True,
                                  null=True,
                                  verbose_name='Término')),
                ('price',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Valor')),
                ('price2x',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Valor em 2x')),
                ('price3x',
                 models.DecimalField(blank=True,
                                     decimal_places=2,
                                     max_digits=10,
                                     null=True,
                                     verbose_name='Valor em 3x')),
                ('vacancies',
                 models.IntegerField(blank=True,
                                     null=True,
                                     verbose_name='Vagas')),
                ('registered',
                 models.IntegerField(blank=True,
                                     default=0,
                                     null=True,
                                     verbose_name='Inscritos')),
                ('pre_booking',
                 models.IntegerField(blank=True,
                                     default=0,
                                     null=True,
                                     verbose_name='Pré-reserva')),
                ('description',
                 wagtail.core.fields.RichTextField(blank=True,
                                                   verbose_name='Descrição')),
            ],
            options={
                'verbose_name': 'Curso',
                'verbose_name_plural': 'Cursos',
            },
            bases=(wagtail.search.index.Indexed, models.Model),
        ),
        migrations.CreateModel(
            name='CoursePage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('slug',
                 django_extensions.db.fields.AutoSlugField(
                     blank=True, editable=False, populate_from='title')),
            ],
            options={
                'verbose_name': 'Página do curso',
                'verbose_name_plural': 'Página do curso',
            },
        ),
        migrations.CreateModel(
            name='FooterText',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('body', wagtail.core.fields.RichTextField()),
            ],
            options={
                'verbose_name_plural': 'Texto do rodapé',
            },
        ),
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('slug',
                 django_extensions.db.fields.AutoSlugField(
                     blank=True,
                     editable=False,
                     help_text='Unique identifier of menu.',
                     populate_from='title')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TeamMember',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=254,
                                          verbose_name='Nome')),
                ('job_title',
                 models.CharField(blank=True,
                                  max_length=254,
                                  verbose_name='Cargo')),
                ('linkedin',
                 models.CharField(blank=True,
                                  help_text='Link para o Linkedin',
                                  max_length=254)),
                ('introduction',
                 models.TextField(help_text='Breve descrição')),
                ('body', wagtail.core.fields.RichTextField()),
                ('image',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.image')),
            ],
            options={
                'verbose_name': 'Pessoa',
                'verbose_name_plural': 'Equipe',
            },
            bases=(wagtail.search.index.Indexed, models.Model),
        ),
        migrations.CreateModel(
            name='StandardPage',
            fields=[
                ('translatablepage_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailtrans.translatablepage')),
                ('introduction',
                 models.TextField(blank=True,
                                  help_text='Texto para descrever a página')),
                ('body',
                 wagtail.core.fields.StreamField(
                     [('heading_block',
                       wagtail.core.blocks.StructBlock(
                           [('heading_text',
                             wagtail.core.blocks.CharBlock(classname='title',
                                                           required=True)),
                            ('size',
                             wagtail.core.blocks.ChoiceBlock(
                                 blank=True,
                                 choices=[('', 'Select a header size'),
                                          ('h2', 'H2'), ('h3', 'H3'),
                                          ('h4', 'H4'), ('h5', 'H5'),
                                          ('h6', 'H6')],
                                 required=False))])),
                      ('paragraph_block',
                       wagtail.core.blocks.RichTextBlock(
                           features=[
                               'bold', 'italic', 'h1', 'h2', 'h3', 'h4', 'h5',
                               'h6', 'ol', 'ul', 'hr', 'link', 'document-link',
                               'image', 'embed', 'code', 'blockquote',
                               'superscript', 'subscript', 'strikethrough'
                           ],
                           icon='fa-paragraph',
                           template='blocks/paragraph_block.html')),
                      ('image_block',
                       wagtail.core.blocks.StructBlock(
                           [('image',
                             wagtail.images.blocks.ImageChooserBlock(
                                 required=True)),
                            ('caption',
                             wagtail.core.blocks.CharBlock(required=False)),
                            ('attribution',
                             wagtail.core.blocks.CharBlock(required=False))])),
                      ('block_quote',
                       wagtail.core.blocks.StructBlock(
                           [('text', wagtail.core.blocks.TextBlock()),
                            ('attribute_name',
                             wagtail.core.blocks.CharBlock(
                                 blank=True,
                                 label='e.g. Mary Berry',
                                 required=False))])),
                      ('embed_block',
                       wagtail.embeds.blocks.EmbedBlock(
                           help_text=
                           'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks',
                           icon='fa-s15',
                           template='blocks/embed_block.html'))],
                     blank=True,
                     verbose_name='Page body')),
                ('image',
                 models.ForeignKey(
                     blank=True,
                     help_text=
                     'Landscape mode only; horizontal width between 1000px and 3000px.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.image')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailtrans.translatablepage', ),
        ),
        migrations.CreateModel(
            name='MenuItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('title',
                 models.CharField(
                     help_text='Title of menu item that will be displayed',
                     max_length=50)),
                ('link_url',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Adicionar link para uma URL, por exemplo: /contato',
                     max_length=500,
                     null=True)),
                ('title_of_submenu',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Title of submenu (LEAVE BLANK if there is no custom submenu)',
                     max_length=50,
                     null=True)),
                ('icon',
                 models.CharField(blank=True,
                                  help_text='Fontawesome icon',
                                  max_length=100)),
                ('show_when',
                 models.CharField(choices=[('always', 'Sempre'),
                                           ('logged_in', 'Quando logado'),
                                           ('not_logged_in',
                                            'Quando não estiver logado')],
                                  default='always',
                                  max_length=15)),
                ('link_page',
                 models.ForeignKey(blank=True,
                                   help_text='Adicionar link para uma página',
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='+',
                                   to='wagtailtrans.translatablepage')),
                ('menu',
                 modelcluster.fields.ParentalKey(
                     help_text='Menu to which this item belongs',
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='menu_items',
                     to='base.menu')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GalleryPage',
            fields=[
                ('translatablepage_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailtrans.translatablepage')),
                ('introduction',
                 models.TextField(blank=True,
                                  help_text='Texto para descrever a página')),
                ('body',
                 wagtail.core.fields.StreamField(
                     [('heading_block',
                       wagtail.core.blocks.StructBlock(
                           [('heading_text',
                             wagtail.core.blocks.CharBlock(classname='title',
                                                           required=True)),
                            ('size',
                             wagtail.core.blocks.ChoiceBlock(
                                 blank=True,
                                 choices=[('', 'Select a header size'),
                                          ('h2', 'H2'), ('h3', 'H3'),
                                          ('h4', 'H4'), ('h5', 'H5'),
                                          ('h6', 'H6')],
                                 required=False))])),
                      ('paragraph_block',
                       wagtail.core.blocks.RichTextBlock(
                           features=[
                               'bold', 'italic', 'h1', 'h2', 'h3', 'h4', 'h5',
                               'h6', 'ol', 'ul', 'hr', 'link', 'document-link',
                               'image', 'embed', 'code', 'blockquote',
                               'superscript', 'subscript', 'strikethrough'
                           ],
                           icon='fa-paragraph',
                           template='blocks/paragraph_block.html')),
                      ('image_block',
                       wagtail.core.blocks.StructBlock(
                           [('image',
                             wagtail.images.blocks.ImageChooserBlock(
                                 required=True)),
                            ('caption',
                             wagtail.core.blocks.CharBlock(required=False)),
                            ('attribution',
                             wagtail.core.blocks.CharBlock(required=False))])),
                      ('block_quote',
                       wagtail.core.blocks.StructBlock(
                           [('text', wagtail.core.blocks.TextBlock()),
                            ('attribute_name',
                             wagtail.core.blocks.CharBlock(
                                 blank=True,
                                 label='e.g. Mary Berry',
                                 required=False))])),
                      ('embed_block',
                       wagtail.embeds.blocks.EmbedBlock(
                           help_text=
                           'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks',
                           icon='fa-s15',
                           template='blocks/embed_block.html'))],
                     blank=True,
                     verbose_name='Page body')),
                ('collection',
                 models.ForeignKey(
                     blank=True,
                     help_text='Select the image collection for this gallery.',
                     limit_choices_to=models.Q(_negated=True,
                                               name__in=['Root']),
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='wagtailcore.collection')),
                ('image',
                 models.ForeignKey(
                     blank=True,
                     help_text=
                     'Landscape mode only; horizontal width between 1000px and 3000px.',
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.image')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailtrans.translatablepage', ),
        ),
        migrations.CreateModel(
            name='FormPage',
            fields=[
                ('translatablepage_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='wagtailtrans.translatablepage')),
                ('intro', wagtail.core.fields.RichTextField(blank=True)),
                ('body',
                 wagtail.core.fields.StreamField([(
                     'form',
                     wagtail.core.blocks.StructBlock([
                         ('form',
                          wagtailstreamforms.blocks.FormChooserBlock()),
                         ('form_action',
                          wagtail.core.blocks.CharBlock(
                              help_text=
                              'The form post action. "" or "." for the current page or a url',
                              required=False)),
                         ('form_reference',
                          wagtailstreamforms.blocks.InfoBlock(
                              help_text=
                              'This form will be given a unique reference once saved',
                              required=False))
                     ]))])),
                ('image',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='wagtailimages.image')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailtrans.translatablepage', ),
        ),
        migrations.CreateModel(
            name='CourseUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('status',
                 models.CharField(choices=[('enroll', 'Inscrição'),
                                           ('pre-booking', 'Pré-reserva')],
                                  max_length=30,
                                  verbose_name='Status')),
                ('date',
                 models.DateTimeField(auto_now_add=True, verbose_name='Data')),
                ('payment_id',
                 models.CharField(blank=True,
                                  max_length=254,
                                  verbose_name='Id do pagamento')),
                ('payment_status',
                 models.CharField(blank=True,
                                  max_length=254,
                                  verbose_name='Status do pagamento')),
                ('payment_note',
                 models.CharField(blank=True,
                                  max_length=254,
                                  verbose_name='Obs')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='base.course',
                                   verbose_name='Curso')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='Usuário')),
            ],
        ),
        migrations.CreateModel(
            name='CoursePageItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('sort_order',
                 models.IntegerField(blank=True, editable=False, null=True)),
                ('description',
                 wagtail.core.fields.RichTextField(blank=True,
                                                   verbose_name='Descrição')),
                ('link_url',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Adicionar link para uma URL, por exemplo: /contato',
                     max_length=254,
                     null=True)),
                ('course_page',
                 modelcluster.fields.ParentalKey(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='course_page_items',
                     to='base.coursepage')),
                ('link_page',
                 models.ForeignKey(blank=True,
                                   help_text='Adicionar link para uma página',
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='+',
                                   to='wagtailtrans.translatablepage')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CourseMaterial',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=254, verbose_name='Título')),
                ('date', models.DateField(verbose_name='Data')),
                ('document',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=base.models.course_directory_path,
                                  verbose_name='Documento')),
                ('video',
                 embed_video.fields.EmbedVideoField(blank=True,
                                                    null=True,
                                                    verbose_name='Vídeo')),
                ('content',
                 wagtail.core.fields.StreamField(
                     [('heading_block',
                       wagtail.core.blocks.StructBlock(
                           [('heading_text',
                             wagtail.core.blocks.CharBlock(classname='title',
                                                           required=True)),
                            ('size',
                             wagtail.core.blocks.ChoiceBlock(
                                 blank=True,
                                 choices=[('', 'Select a header size'),
                                          ('h2', 'H2'), ('h3', 'H3'),
                                          ('h4', 'H4'), ('h5', 'H5'),
                                          ('h6', 'H6')],
                                 required=False))])),
                      ('paragraph_block',
                       wagtail.core.blocks.RichTextBlock(
                           features=[
                               'bold', 'italic', 'h1', 'h2', 'h3', 'h4', 'h5',
                               'h6', 'ol', 'ul', 'hr', 'link', 'document-link',
                               'image', 'embed', 'code', 'blockquote',
                               'superscript', 'subscript', 'strikethrough'
                           ],
                           icon='fa-paragraph',
                           template='blocks/paragraph_block.html')),
                      ('image_block',
                       wagtail.core.blocks.StructBlock(
                           [('image',
                             wagtail.images.blocks.ImageChooserBlock(
                                 required=True)),
                            ('caption',
                             wagtail.core.blocks.CharBlock(required=False)),
                            ('attribution',
                             wagtail.core.blocks.CharBlock(required=False))])),
                      ('block_quote',
                       wagtail.core.blocks.StructBlock(
                           [('text', wagtail.core.blocks.TextBlock()),
                            ('attribute_name',
                             wagtail.core.blocks.CharBlock(
                                 blank=True,
                                 label='e.g. Mary Berry',
                                 required=False))])),
                      ('embed_block',
                       wagtail.embeds.blocks.EmbedBlock(
                           help_text=
                           'Insert an embed URL e.g https://www.youtube.com/embed/SGJFWirQ3ks',
                           icon='fa-s15',
                           template='blocks/embed_block.html'))],
                     blank=True,
                     verbose_name='Conteúdo')),
                ('course',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='base.course',
                                   verbose_name='Curso')),
            ],
            options={
                'verbose_name': 'Material do curso',
                'verbose_name_plural': 'Materiais do curso',
            },
            bases=(wagtail.search.index.Indexed, models.Model),
        ),
        migrations.CreateModel(
            name='AdvancedFormSetting',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('to_address', models.EmailField(max_length=254)),
                ('form',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='advanced_settings',
                     to='wagtailstreamforms.form')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    dependencies = [
        ('wagtailimages', '0022_uploadedimage'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wagtailtrans', '0009_create_initial_language'),
        ('taggit', '0003_taggeditem_add_unique_index'),
        ('base', '0005_teammember_order'),
    ]

    operations = [
        migrations.CreateModel(
            name='CourseTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CourseUserInterview',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('show_button', models.BooleanField(default=False, verbose_name='Show payment button')),
            ],
        ),
        migrations.RemoveField(
            model_name='coursepageitem',
            name='course_page',
        ),
        migrations.RemoveField(
            model_name='coursepageitem',
            name='link_page',
        ),
        migrations.AlterModelOptions(
            name='course',
            options={'verbose_name': 'Course', 'verbose_name_plural': 'Courses'},
        ),
        migrations.AlterModelOptions(
            name='coursematerial',
            options={'verbose_name': 'Course material', 'verbose_name_plural': 'Course materials'},
        ),
        migrations.AlterModelOptions(
            name='footertext',
            options={'verbose_name_plural': 'Footer Text'},
        ),
        migrations.AlterModelOptions(
            name='teammember',
            options={'verbose_name': 'Person', 'verbose_name_plural': 'Team'},
        ),
        migrations.AddField(
            model_name='course',
            name='image',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image'),
        ),
        migrations.AddField(
            model_name='course',
            name='introduction',
            field=models.CharField(default='teste', max_length=254, verbose_name='Introduction'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='course',
            name='price4x',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Price 4x'),
        ),
        migrations.AddField(
            model_name='course',
            name='type',
            field=models.CharField(choices=[('admin', 'Admin'), ('individual', 'Individual'), ('group', 'Group'), ('recorded', 'Recorded')], default='group', max_length=15, verbose_name='Tipo'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='course',
            name='description',
            field=wagtail.core.fields.RichTextField(blank=True, verbose_name='Description'),
        ),
        migrations.AlterField(
            model_name='course',
            name='end_date',
            field=models.DateField(blank=True, null=True, verbose_name='End date'),
        ),
        migrations.AlterField(
            model_name='course',
            name='end_time',
            field=models.TimeField(blank=True, null=True, verbose_name='End time'),
        ),
        migrations.AlterField(
            model_name='course',
            name='pre_booking',
            field=models.IntegerField(blank=True, default=0, null=True, verbose_name='Pre-booking'),
        ),
        migrations.AlterField(
            model_name='course',
            name='price',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Price'),
        ),
        migrations.AlterField(
            model_name='course',
            name='price2x',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Price 2x'),
        ),
        migrations.AlterField(
            model_name='course',
            name='price3x',
            field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Price 3x'),
        ),
        migrations.AlterField(
            model_name='course',
            name='registered',
            field=models.IntegerField(blank=True, default=0, null=True, verbose_name='Registered'),
        ),
        migrations.AlterField(
            model_name='course',
            name='start_date',
            field=models.DateField(blank=True, null=True, verbose_name='Start date'),
        ),
        migrations.AlterField(
            model_name='course',
            name='start_time',
            field=models.TimeField(blank=True, null=True, verbose_name='Start time'),
        ),
        migrations.AlterField(
            model_name='course',
            name='vacancies',
            field=models.IntegerField(blank=True, null=True, verbose_name='Vacancies'),
        ),
        migrations.AlterField(
            model_name='coursematerial',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.course', verbose_name='Course'),
        ),
        migrations.AlterField(
            model_name='coursematerial',
            name='description',
            field=wagtail.core.fields.RichTextField(blank=True, verbose_name='Description'),
        ),
        migrations.AlterField(
            model_name='coursematerial',
            name='link',
            field=models.URLField(blank=True, null=True, verbose_name='Broadcast link'),
        ),
        migrations.AlterField(
            model_name='coursematerialvideo',
            name='video',
            field=models.FileField(blank=True, max_length=254, null=True, upload_to=base.models.course_directory_path, verbose_name='Video'),
        ),
        migrations.AlterField(
            model_name='courseuser',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.course', verbose_name='Course'),
        ),
        migrations.AlterField(
            model_name='courseuser',
            name='payment_id',
            field=models.CharField(blank=True, max_length=254, verbose_name='Payment Id'),
        ),
        migrations.AlterField(
            model_name='courseuser',
            name='payment_note',
            field=models.CharField(blank=True, max_length=254, verbose_name='Nota'),
        ),
        migrations.AlterField(
            model_name='courseuser',
            name='payment_status',
            field=models.CharField(blank=True, max_length=254, verbose_name='Payment status'),
        ),
        migrations.AlterField(
            model_name='courseuser',
            name='status',
            field=models.CharField(choices=[('enroll', 'Enroll'), ('pre-booking', 'Pre-booking')], max_length=30, verbose_name='Status'),
        ),
        migrations.AlterField(
            model_name='gallerypage',
            name='introduction',
            field=models.TextField(blank=True, help_text='Text to describe the page'),
        ),
        migrations.AlterField(
            model_name='menuitem',
            name='link_page',
            field=models.ForeignKey(blank=True, help_text='Page to link to', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailtrans.translatablepage'),
        ),
        migrations.AlterField(
            model_name='menuitem',
            name='link_url',
            field=models.CharField(blank=True, help_text='URL to link to, e.g. /contato', max_length=500, null=True),
        ),
        migrations.AlterField(
            model_name='menuitem',
            name='show_when',
            field=models.CharField(choices=[('always', 'Always'), ('logged_in', 'When logged in'), ('not_logged_in', 'When not logged in')], default='always', max_length=15),
        ),
        migrations.AlterField(
            model_name='standardpage',
            name='introduction',
            field=models.TextField(blank=True, help_text='Text to describe the page'),
        ),
        migrations.AlterField(
            model_name='teammember',
            name='introduction',
            field=models.TextField(help_text='Brief description'),
        ),
        migrations.AlterField(
            model_name='teammember',
            name='job_title',
            field=models.CharField(blank=True, max_length=254, verbose_name='Job title'),
        ),
        migrations.AlterField(
            model_name='teammember',
            name='linkedin',
            field=models.CharField(blank=True, help_text='Link to Linkedin', max_length=254),
        ),
        migrations.AlterField(
            model_name='teammember',
            name='order',
            field=models.IntegerField(blank=True, default=10, verbose_name='Position'),
        ),
        migrations.DeleteModel(
            name='CoursePage',
        ),
        migrations.DeleteModel(
            name='CoursePageItem',
        ),
        migrations.AddField(
            model_name='courseuserinterview',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.course', verbose_name='Course'),
        ),
        migrations.AddField(
            model_name='courseuserinterview',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Usuário'),
        ),
        migrations.AddField(
            model_name='coursetag',
            name='content_object',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_courses', to='base.course'),
        ),
        migrations.AddField(
            model_name='coursetag',
            name='tag',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='base_coursetag_items', to='taggit.tag'),
        ),
        migrations.AddField(
            model_name='course',
            name='tags',
            field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='base.CourseTag', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]
Ejemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description',
                 models.TextField(blank=True, max_length=10000, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description',
                 models.TextField(blank=True, max_length=10000, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('file', models.FileField(upload_to='')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description',
                 models.TextField(blank=True, max_length=10000, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('image', models.ImageField(upload_to='')),
                ('alt_text',
                 models.TextField(blank=True, max_length=1000, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('role',
                 models.CharField(choices=[('customer', 'Customer'),
                                           ('manager', 'Manager')],
                                  default=('customer', 'Customer'),
                                  max_length=20)),
                ('status', models.BooleanField(default=False)),
                ('phone_number',
                 models.CharField(blank=True, max_length=20, null=True)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description',
                 models.TextField(blank=True, max_length=10000, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('content', djrichtextfield.models.RichTextField()),
                ('Files', models.ManyToManyField(to='base.File')),
                ('categories', models.ManyToManyField(to='base.Category')),
                ('created_by',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='base.Profile')),
                ('images', models.ManyToManyField(to='base.Image')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='OTP',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message',
                 models.CharField(blank=True,
                                  default=base.models.random_with_N_digits,
                                  max_length=7,
                                  null=True)),
                ('is_valid', models.BooleanField(default=True)),
                ('profile',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='base.Profile')),
            ],
        ),
        migrations.AddField(
            model_name='image',
            name='created_by',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='base.Profile'),
        ),
        migrations.AddField(
            model_name='file',
            name='created_by',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='base.Profile'),
        ),
        migrations.AddField(
            model_name='category',
            name='created_by',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='base.Profile'),
        ),
        migrations.AddField(
            model_name='category',
            name='parent',
            field=mptt.fields.TreeForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='children',
                to='base.Category'),
        ),
    ]