Example #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('csecourses', '__first__'),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=10000, null=True)),
                ('type', enumfields.fields.EnumField(enum=campaigns.models.CampaignType, max_length=1000)),
                ('slug', models.SlugField(blank=True, null=True)),
                ('image', sorl.thumbnail.fields.ImageField(blank=True, height_field='height_field', null=True, upload_to=campaigns.models.campaign_image_upload_location, width_field='width_field')),
                ('banner_image', models.ImageField(blank=True, height_field='banner_height_field', null=True, upload_to=campaigns.models.campaign_image_upload_location, width_field='banner_width_field')),
                ('width_field', models.IntegerField(default=0)),
                ('height_field', models.IntegerField(default=0)),
                ('banner_width_field', models.IntegerField(default=0)),
                ('banner_height_field', models.IntegerField(default=0)),
                ('description', models.TextField(blank=True, null=True)),
                ('duration_days', models.IntegerField(blank=True, null=True)),
                ('course_data', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='csecourses.CSECourseGroupTerm')),
            ],
        ),
        migrations.CreateModel(
            name='CampaignPartyRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('type', enumfields.fields.EnumField(enum=campaigns.models.CampaignPartyRelationType, max_length=1000)),
                ('campaign', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='campaigns.Campaign')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='campaign',
            unique_together={('slug', 'type')},
        ),
    ]
Example #2
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('duration', models.DurationField(verbose_name=datetime.timedelta(days=30))),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('description', models.TextField(blank=True, default='Campaign description...', max_length=255)),
                ('discount', models.IntegerField(default=0)),
                ('numbermembers', models.IntegerField(default=0)),
                ('slug', models.IntegerField(default=campaigns.models.Campaign.random_code, unique=True)),
                ('members', models.ManyToManyField(related_name='membership', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('default_font',
                 models.CharField(blank=True,
                                  choices=[('AR', 'Arial'), ('CL', 'Calibari'),
                                           ('HL', 'Halvetica'),
                                           ('TR', 'Times Roman')],
                                  max_length=4)),
                ('default_font_size',
                 models.CharField(blank=True, max_length=32)),
                ('order', models.PositiveIntegerField()),
            ],
            options={
                'verbose_name_plural': 'Entities',
            },
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('length', models.CharField(max_length=32)),
                ('height', models.CharField(max_length=32)),
                ('entities', models.ManyToManyField(to='campaigns.Entity')),
            ],
        ),
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('unique_id',
                 models.CharField(blank=True,
                                  default=campaigns.models.unique_id_generator,
                                  max_length=64)),
                ('name', models.CharField(blank=True, max_length=64)),
                ('footer_file',
                 models.FileField(
                     upload_to='campaigns/footer_files/',
                     validators=[
                         django.core.validators.FileExtensionValidator(
                             allowed_extensions='pdf')
                     ])),
                ('quantity', models.PositiveIntegerField(default=100)),
                ('amount', models.DecimalField(decimal_places=2,
                                               max_digits=8)),
                ('extra_charges',
                 models.DecimalField(decimal_places=2,
                                     help_text='GST and other charges',
                                     max_digits=8)),
                ('total_amount',
                 models.DecimalField(decimal_places=2, max_digits=8)),
                ('printed_copies', models.PositiveIntegerField(default=0)),
                ('status',
                 models.CharField(choices=[('PP', 'Payment Pending'),
                                           ('DC', 'Declined'),
                                           ('NA', 'Not Approved'),
                                           ('AP', 'Approved'),
                                           ('RN', 'Running'),
                                           ('FN', 'Finished'),
                                           ('CN', 'Cancelled')],
                                  default='PP',
                                  max_length=2)),
                ('is_finished', models.BooleanField(default=False)),
                ('is_payed', models.BooleanField(default=False)),
                ('is_approved', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('size',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='campaigns.Size')),
                ('sub_industry',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='industries.SubCategory')),
                ('sub_locality',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='localities.SubLocality')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Example #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Note',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private', models.BooleanField(blank=True, null=True)),
                ('note', models.TextField(default=' ')),
                ('order_position', models.IntegerField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('identifier', models.BooleanField(default=False)),
                ('tag', models.CharField(default=' ', max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='Card',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('img',
                 models.ImageField(blank=True, null=True, upload_to='card/')),
                ('name', models.CharField(default=' ', max_length=256)),
                ('description', models.TextField(blank=True, null=True)),
                ('notes',
                 models.ManyToManyField(blank=True, to='campaigns.Note')),
                ('tags', models.ManyToManyField(blank=True,
                                                to='campaigns.Tag')),
            ],
        ),
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('private', models.BooleanField(blank=True, null=True)),
                ('img',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to='campaign/')),
                ('title', models.CharField(default=' ', max_length=256)),
                ('description', models.TextField(blank=True, null=True)),
                ('cards',
                 models.ManyToManyField(blank=True, to='campaigns.Card')),
                ('creator',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=models.SET(
                                       campaigns.models.get_sentinel_user),
                                   related_name='creator',
                                   to=settings.AUTH_USER_MODEL)),
                ('owner',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=models.SET(
                                       campaigns.models.get_sentinel_user),
                                   related_name='owner',
                                   to=settings.AUTH_USER_MODEL)),
                ('parties',
                 models.ManyToManyField(blank=True, to='adventurer.Party')),
                ('tags', models.ManyToManyField(blank=True,
                                                to='campaigns.Tag')),
            ],
        ),
    ]