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

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='CustomerUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('email', models.EmailField(max_length=100, unique=True)),
                ('full_name', models.CharField(max_length=50, null=True)),
                ('is_moderator', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
    ]
コード例 #2
0
class ContactUsModel(models.Model):
    """Contact Us Model for the site by User"""
    email = models.EmailField("Email",
                              max_length=50,
                              blank=True,
                              validators=[EMAILREGEX])
    first_name = models.CharField("First Name",
                                  max_length=40,
                                  validators=[NAMEREGEX],
                                  blank=True)
    last_name = models.CharField("Last Name",
                                 max_length=40,
                                 validators=[NAMEREGEX],
                                 blank=True,
                                 null=True)
    mobile_number = models.CharField("Mobile Number",
                                     max_length=16,
                                     blank=False,
                                     validators=[MOBILEREGEX])
    message = RichTextField("message", blank=False)

    def __str__(self):
        return email

    class Meta:
        verbose_name_plural = "Post Contact Us"
コード例 #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Students',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=200)),
                ('fname', models.CharField(max_length=200)),
                ('last_name', models.CharField(max_length=200)),
                ('date_of_birth', models.DateField()),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to=app.models.overwrite)),
                ('created_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['created_at'],
            },
        ),
    ]
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('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')),
                ('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',
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Catogory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app.models.get_image_path)),
                ('weight', models.DecimalField(decimal_places=2,
                                               max_digits=5)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('last_name', models.CharField(blank=True, max_length=200)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=200)),
                ('role',
                 models.CharField(choices=[
                     ('CLINIC_MANAGER', 'Clinic Manager'),
                     ('WAREHOUSE_PERSONNEL', 'Warehouse Personnel'),
                     ('DISPATCHER', 'Dispatcher')
                 ],
                                  default='CLINIC_MANAGER',
                                  max_length=2)),
            ],
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Provider',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('email', models.EmailField(max_length=254)),
                ('language',
                 models.CharField(choices=[('en_US', 'English'),
                                           ('pt_BR', 'Brazilian Portuguese')],
                                  max_length=5,
                                  verbose_name='Language')),
                ('currency',
                 models.CharField(choices=[('USD', 'Dollar'), ('BRL', 'Real')],
                                  max_length=3,
                                  verbose_name='Currency')),
                ('phone_number',
                 models.CharField(max_length=40, verbose_name='Phone number')),
            ],
        ),
        migrations.CreateModel(
            name='ServiceArea',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('price', models.FloatField(verbose_name='Price')),
                ('points',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=app.models.PointField(
                         base_field=models.FloatField(), size=2),
                     size=None)),
                ('provider',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='service_areas',
                                   to='app.Provider')),
            ],
        ),
    ]
コード例 #7
0
ファイル: models.py プロジェクト: ChicheT/CAM2WebUI
class JoinModel(models.Model):
    """Model to store backups of the applications sent to the CAM2 email address"""
    class Meta:
        verbose_name = 'application'

    name = models.CharField(verbose_name='Name', max_length=100)
    from_email = models.EmailField()
    major = models.CharField(verbose_name='Major', max_length=1000)
    gradDate = models.CharField(verbose_name='Graduation Date',
                                max_length=1000)
    courses = models.CharField(verbose_name='Courses Taken',
                               max_length=1000,
                               blank=True,
                               null=True)
    languages = models.CharField(verbose_name='Programming Languages',
                                 max_length=1000)
    tools = models.CharField(verbose_name='Development Tools',
                             max_length=1000,
                             blank=True,
                             null=True)
    whyCAM2 = models.CharField(verbose_name='Reason to Join', max_length=1000)
    anythingElse = models.CharField(verbose_name='Additional Information',
                                    max_length=1000,
                                    blank=True,
                                    null=True)
    date = models.DateTimeField(auto_now_add=True)
    favoriteTeams = models.CharField(verbose_name='4 Favorite Teams',
                                     max_length=150,
                                     blank=True,
                                     null=True)
    knowledge = models.CharField(verbose_name='Knowledge in Various Fields',
                                 max_length=1000,
                                 blank=True,
                                 null=True)
    teamwork = models.CharField(verbose_name='Expirience in Teamwork',
                                max_length=1000,
                                blank=True,
                                null=True)
    problem = models.CharField(verbose_name='Explain Problem',
                               max_length=1000,
                               blank=True,
                               null=True)
    futureLeader = models.BooleanField(verbose_name='Wants to be a Leader',
                                       blank=True)
    semester = models.ForeignKey('ApplicationDeadline',
                                 verbose_name='Application Semester',
                                 on_delete=models.CASCADE)

    def __str__(self):
        return "{0}".format(self.name)
コード例 #8
0
class UserReference(models.Model):
    """Invite people Model"""
    sender = models.ForeignKey(MyUser,
                               related_name='sender_referer',
                               on_delete=models.CASCADE)
    receiver = models.EmailField("Reciver",
                                 validators=[EMAILREGEX],
                                 max_length=50)
    url = models.URLField("Url of site")
    created_at = models.DateTimeField(auto_now_add=True, blank=True, null=True)

    def __str__(self):
        return self.sender.email

    class Meta:
        verbose_name_plural = "Invite User"
コード例 #9
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.ASCIIUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('name', models.CharField(max_length=20, verbose_name='Nome')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='E-mail')),
                ('city', models.CharField(max_length=20, verbose_name='Cidade')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=15, verbose_name='Nome')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Pre\xe7o')),
                ('stock', models.IntegerField(verbose_name='Estoque')),
            ],
        ),
    ]
コード例 #10
0
ファイル: 0003_uslaperson.py プロジェクト: virsunen/usla2018
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app', '0002_auto_20180606_2313'),
    ]

    operations = [
        migrations.CreateModel(
            name='UslaPerson',
            fields=[
                ('usla_id', models.AutoField(primary_key=True,
                                             serialize=False)),
                ('first_name', models.CharField(max_length=60)),
                ('last_name', models.CharField(max_length=60)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('tel_num',
                 models.CharField(blank=True,
                                  max_length=16,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message=b'Phone number invalid.',
                                          regex=b'^\\+?1?[\\d-]{9,18}$')
                                  ])),
                ('cel_num',
                 models.CharField(blank=True,
                                  max_length=16,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message=b'Phone number invalid.',
                                          regex=b'^\\+?1?[\\d-]{9,18}$')
                                  ])),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to=app.models.
                                   get_upload_usla_family_membership_images)),
                ('image_thumb',
                 models.ImageField(blank=True,
                                   upload_to=app.models.
                                   get_upload_usla_family_membership_images)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #11
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0018_auto_20191027_2106'),
    ]

    operations = [
        migrations.AlterField(
            model_name='student',
            name='email',
            field=models.EmailField(
                max_length=255,
                unique=True,
                validators=[app.models.validate_suponly_email],
                verbose_name='email address'),
        ),
    ]
コード例 #12
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Doctor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lastname', models.CharField(max_length=100)),
                ('firstname', models.CharField(max_length=100)),
                ('middlename', models.CharField(max_length=100)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('lastname', models.CharField(max_length=100)),
                ('firstname', models.CharField(max_length=100)),
                ('middlename', models.CharField(max_length=100)),
                ('phone', models.CharField(max_length=20)),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('test', models.CharField(max_length=100)),
                ('file_path', models.FileField(upload_to=app.models.make_file_path_name)),
                ('notes', models.TextField()),
                ('result', models.CharField(max_length=100)),
                ('time', models.DateTimeField()),
                ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.doctor')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.patient')),
            ],
        ),
    ]
コード例 #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ContactUser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email_address', models.EmailField(max_length=254)),
                ('phone_number',
                 models.CharField(
                     max_length=20,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             'Only numbers, (, ), -, +, and spaces are allowed.',
                             regex='^[0-9\\-\\(\\) \\+]+$'),
                         app.models.integers_validator
                     ])),
                ('my_property_type',
                 models.CharField(choices=[('S', 'Single Family'),
                                           ('H', 'Highrise Condo'),
                                           ('T', 'Townhouse')],
                                  max_length=1)),
                ('notes',
                 models.TextField(
                     blank=True,
                     default='',
                     validators=[
                         django.core.validators.MinLengthValidator(
                             10,
                             message=
                             'Notes must consist of at least 10 characters.')
                     ])),
            ],
        ),
    ]
コード例 #14
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0002_auto_20170226_0857'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.AlterField(
            model_name='post',
            name='code',
            field=models.FileField(upload_to=app.models.user_directory_path),
        ),
    ]
コード例 #15
0
ファイル: models.py プロジェクト: ChicheT/CAM2WebUI
class ContactModel(models.Model):
    """Model to store backups of the emails sent to the CAM2 email address"""
    class Meta:
        verbose_name = 'contact'

    name = models.CharField(verbose_name='Name',
                            max_length=100,
                            blank=True,
                            null=True)
    from_email = models.EmailField()
    subject = models.CharField(verbose_name='Subject',
                               max_length=100,
                               blank=True,
                               null=True)
    message = models.CharField(verbose_name='Message',
                               max_length=500,
                               blank=True,
                               null=True)
    date = models.DateField(blank=True, null=True)

    def __str__(self):
        return "{0}".format(self.subject)
コード例 #16
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('description', models.CharField(max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Component',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.TextField()),
                ('type', models.TextField()),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Cwe',
            fields=[
                ('cwe', models.IntegerField(primary_key=True, serialize=False)),
                ('description', models.TextField()),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Finding',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=512)),
                ('path', models.CharField(max_length=1024)),
                ('line_number', models.IntegerField(null=True)),
                ('line', models.TextField()),
                ('snippet', models.TextField()),
                ('match', models.TextField(blank=True, null=True)),
                ('status', models.CharField(choices=[('VF', 'Verified'), ('FP', 'False Positive'), ('TP', 'True Positive'), ('MI', 'Mitigated'), ('UK', 'Unknown'), ('TD', 'To Do')], max_length=50)),
                ('severity', models.CharField(choices=[('CR', 'Critical'), ('HI', 'High'), ('ME', 'Medium'), ('LO', 'Low'), ('NO', 'None')], max_length=10)),
                ('description', models.TextField()),
                ('mitigation', models.TextField(blank=True, null=True)),
                ('defectdojo_id', models.IntegerField(blank=True, default=0)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('cwe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.cwe')),
            ],
        ),
        migrations.CreateModel(
            name='Malware',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('date', models.CharField(max_length=255, null=True)),
                ('url', models.TextField(blank=True, null=True)),
                ('ip', models.TextField(blank=True, null=True)),
                ('reverse_lookup', models.TextField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('asp', models.CharField(max_length=255, null=True)),
                ('geolocation', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='PermissionType',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.TextField(unique=True)),
                ('type', models.CharField(max_length=50)),
                ('default_severity', models.CharField(choices=[('CR', 'Critical'), ('HI', 'High'), ('ME', 'Medium'), ('LO', 'Low'), ('NO', 'None')], max_length=10)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Scan',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(blank=True, max_length=255)),
                ('apk', models.FileField(upload_to='apk/', validators=[app.models.validate_file_extension])),
                ('description', models.CharField(max_length=255)),
                ('defectdojo_id', models.IntegerField(blank=True, default=0)),
                ('status', models.CharField(blank=True, max_length=50, null=True)),
                ('progress', models.IntegerField(blank=True, null=True)),
                ('findings', models.IntegerField(blank=True, default=0, null=True)),
                ('apk_name', models.CharField(blank=True, max_length=255, null=True)),
                ('file_size', models.CharField(blank=True, max_length=255, null=True)),
                ('md5', models.CharField(blank=True, max_length=255, null=True)),
                ('sha1', models.CharField(blank=True, max_length=255, null=True)),
                ('sha256', models.CharField(blank=True, max_length=255, null=True)),
                ('package', models.CharField(blank=True, max_length=255, null=True)),
                ('icon', models.TextField(blank=True, null=True)),
                ('version_code', models.CharField(blank=True, max_length=50, null=True)),
                ('version_name', models.CharField(blank=True, max_length=50, null=True)),
                ('min_sdk_version', models.CharField(blank=True, max_length=50, null=True)),
                ('max_sdk_version', models.CharField(blank=True, max_length=50, null=True)),
                ('target_sdk_version', models.CharField(blank=True, max_length=50, null=True)),
                ('effective_target_sdk_version', models.CharField(blank=True, max_length=50, null=True)),
                ('manifest', models.TextField(blank=True, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('app', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.application')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='VirusTotalScan',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('identifier', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('date', models.DateTimeField(null=True)),
                ('md5', models.CharField(max_length=255, null=True)),
                ('sha256', models.CharField(max_length=255, null=True)),
                ('ssdeep', models.CharField(max_length=255, null=True)),
                ('link', models.TextField(blank=True, null=True)),
                ('harmless', models.IntegerField(blank=True, default=0)),
                ('malicious', models.IntegerField(blank=True, default=0)),
                ('suspicious', models.IntegerField(blank=True, default=0)),
                ('undetected', models.IntegerField(blank=True, default=0)),
                ('unsupported', models.IntegerField(blank=True, default=0)),
                ('type_unsupported', models.IntegerField(blank=True, default=0)),
                ('failure', models.IntegerField(blank=True, default=0)),
                ('timeout', models.IntegerField(blank=True, default=0)),
                ('uploaded', models.BooleanField(default=False)),
                ('first_seen', models.DateTimeField(null=True)),
                ('first_submission', models.DateTimeField(null=True)),
                ('last_submission', models.DateTimeField(null=True)),
                ('reputation', models.IntegerField(blank=True, default=0)),
                ('times_submitted', models.IntegerField(blank=True, default=0)),
                ('votes_harmless', models.IntegerField(blank=True, default=0)),
                ('votes_malicious', models.IntegerField(blank=True, default=0)),
                ('magic', models.CharField(max_length=255, null=True)),
                ('type_description', models.CharField(max_length=255, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='String',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('type', models.CharField(max_length=255)),
                ('value', models.TextField(blank=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('finding', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.finding')),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=100)),
                ('last_name', models.CharField(blank=True, max_length=100)),
                ('email', models.EmailField(max_length=150)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('severity', models.CharField(choices=[('CR', 'Critical'), ('HI', 'High'), ('ME', 'Medium'), ('LO', 'Low'), ('NO', 'None')], max_length=10)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.permissiontype')),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='Pattern',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('default_name', models.TextField()),
                ('default_description', models.TextField(blank=True)),
                ('default_severity', models.CharField(choices=[('CR', 'Critical'), ('HI', 'High'), ('ME', 'Medium'), ('LO', 'Low'), ('NO', 'None')], max_length=10)),
                ('default_mitigation', models.TextField(blank=True)),
                ('pattern', models.TextField()),
                ('active', models.BooleanField(default=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('default_cwe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.cwe')),
            ],
        ),
        migrations.CreateModel(
            name='IntentFilter',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.TextField()),
                ('action', models.TextField()),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('component', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.component')),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.AddField(
            model_name='finding',
            name='scan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan'),
        ),
        migrations.AddField(
            model_name='finding',
            name='type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.pattern'),
        ),
        migrations.AddField(
            model_name='finding',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('type', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('path', models.CharField(max_length=255)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('domain', models.TextField(blank=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('finding', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.finding')),
                ('malware', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app.malware')),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='DatabaseInfo',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('table', models.CharField(max_length=255)),
                ('info', models.TextField(blank=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.AddField(
            model_name='component',
            name='scan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan'),
        ),
        migrations.CreateModel(
            name='Certificate',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('version', models.CharField(blank=True, max_length=10)),
                ('sha1', models.CharField(blank=True, max_length=255)),
                ('sha256', models.CharField(blank=True, max_length=255)),
                ('issuer', models.TextField(blank=True)),
                ('subject', models.TextField(blank=True)),
                ('hash_algorithm', models.TextField(blank=True)),
                ('signature_algorithm', models.TextField(blank=True)),
                ('serial_number', models.TextField(blank=True)),
                ('contents', models.TextField(blank=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
        migrations.CreateModel(
            name='Antivirus',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255, null=True)),
                ('category', models.CharField(max_length=255, null=True)),
                ('version', models.CharField(max_length=255, null=True)),
                ('result', models.CharField(max_length=255, null=True)),
                ('method', models.CharField(max_length=255, null=True)),
                ('update', models.CharField(max_length=255, null=True)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
                ('virus_scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.virustotalscan')),
            ],
        ),
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.TextField()),
                ('main', models.BooleanField(default=False)),
                ('exported', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_on', models.DateTimeField(auto_now=True, null=True)),
                ('scan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.scan')),
            ],
        ),
    ]
コード例 #17
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('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,
            },
        ),
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('dataset', models.FileField(storage=classify.storage_backends.PrivateMediaStorage(), upload_to='datasets/', validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['xlsx']), app.models.validate_dataset_size])),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='owner_datasets', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='ClassificationModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('saved', models.BooleanField(default=False)),
                ('training_columns', annoying.fields.JSONField(blank=True, deserializer=json.loads, null=True, serializer=annoying.fields.dumps)),
                ('variables', annoying.fields.JSONField(blank=True, deserializer=json.loads, null=True, serializer=annoying.fields.dumps)),
                ('goal', models.CharField(blank=True, max_length=100, null=True)),
                ('trained_model', models.FileField(blank=True, null=True, storage=classify.storage_backends.PrivateMediaStorage(), upload_to='models/')),
                ('training_acc', models.FloatField(blank=True, null=True)),
                ('test_acc', models.FloatField(blank=True, null=True)),
                ('dataset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='models', to='app.Dataset')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='owner_models', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created',),
            },
        ),
    ]
コード例 #18
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('address_line1', models.CharField(max_length=50)),
                ('address_line2', models.CharField(blank=True, max_length=50, null=True)),
                ('town_city', models.CharField(max_length=50)),
                ('county', models.CharField(max_length=50)),
                ('eir_code', models.CharField(max_length=50, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('category_description', models.TextField(max_length=400)),
                ('category_image', models.ImageField(blank=True, default='', upload_to=app.models.upload_path)),
            ],
        ),
        migrations.CreateModel(
            name='Shop',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False, unique=True)),
                ('business_reg', models.CharField(max_length=10, unique=True)),
                ('shop_name', models.CharField(max_length=50)),
                ('slogan', models.CharField(blank=True, max_length=150, null=True)),
                ('description', models.TextField(max_length=500)),
                ('logo', models.ImageField(default='', upload_to='logos')),
                ('shop_image', models.ImageField(blank=True, default='', upload_to=app.models.upload_path)),
                ('phone_no', models.IntegerField(default=0)),
                ('email', models.EmailField(max_length=254)),
                ('address_line1', models.CharField(default='', max_length=50)),
                ('address_line2', models.CharField(blank=True, max_length=50, null=True)),
                ('town_city', models.CharField(default='', max_length=50)),
                ('county', models.CharField(default='', max_length=50)),
                ('eir_code', models.CharField(default='', max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('product_code', models.AutoField(auto_created=True, primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(blank=True, max_length=50)),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=1000)),
                ('product_image', models.ImageField(blank=True, default='', null=True, upload_to=app.models.upload_path)),
                ('product_description', models.TextField(blank=True, max_length=250)),
                ('quantity', models.IntegerField(blank=True, default=0)),
                ('colour', models.CharField(blank=True, choices=[('Red', 'Red'), ('Blue', 'Blue'), ('Green', 'Green'), ('Orange', 'Orange'), ('Yellow', 'Yellow'), ('White', 'White'), ('Black', 'Black'), ('Navy', 'Navy'), ('Brown', 'Brown'), ('Purple', 'Purple'), ('Pink', 'Pink')], default='Black', max_length=10)),
                ('stock', models.CharField(blank=True, choices=[('In Stock', 'In Stock'), ('Out Of Stock', 'Out Of Stock')], default='In Stock', max_length=50)),
                ('shipping_fee', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=1000)),
                ('entry_date', models.DateTimeField(auto_now_add=True, null=True)),
                ('last_update', models.DateTimeField(auto_now=True, null=True)),
                ('weight', models.DecimalField(blank=True, decimal_places=1, default=0, max_digits=100)),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='app.category', to_field='name')),
                ('shop', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='app.shop')),
            ],
        ),
    ]
コード例 #19
0
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')),
                ('grade',
                 models.IntegerField(blank=True,
                                     default=0,
                                     null=True,
                                     verbose_name='grade')),
                ('school_name',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name='school name')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('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')),
                ('society_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='society name')),
                ('is_student', models.BooleanField(default=False)),
                ('is_society', models.BooleanField(default=False)),
                ('is_company', models.BooleanField(default=False)),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('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')),
                ('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',
            },
            managers=[
                ('objects', app.models.CustomUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='BoardModel',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100,
                                           verbose_name='タイトル')),
                ('content', models.TextField(verbose_name='本文')),
                ('author', models.CharField(max_length=100)),
                ('images',
                 models.ImageField(blank=True,
                                   upload_to='image',
                                   verbose_name='画像')),
                ('good', models.IntegerField()),
                ('read', models.IntegerField()),
                ('readtext', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     related_name='company',
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     related_name='student',
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #20
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Agenda',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('dia',
                 models.DateField(validators=[
                     app.models.Agenda.validar_data_de_agendamento
                 ])),
            ],
            options={
                'ordering': ['dia'],
            },
        ),
        migrations.CreateModel(
            name='Especialidade',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('especialidade', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='userProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Medico',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nome', models.CharField(max_length=100, unique=True)),
                ('crm', models.CharField(max_length=10, unique=True)),
                ('email',
                 models.EmailField(blank=True, max_length=254, unique=True)),
                ('telefone', models.CharField(blank=True, max_length=20)),
                ('especialidade',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Especialidade')),
            ],
        ),
        migrations.CreateModel(
            name='Consulta',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('dia', models.DateField()),
                ('horario', models.TimeField()),
                ('data_agendamento', models.DateTimeField(auto_now=True)),
                ('agenda',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='agenda',
                                   to='app.Agenda')),
                ('paciente',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Consulta',
                'verbose_name_plural': 'Consultas',
                'ordering': ['dia', 'horario'],
            },
        ),
        migrations.AddField(
            model_name='agenda',
            name='medico',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='medico',
                to='app.Medico'),
        ),
        migrations.CreateModel(
            name='Horario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('horario', models.TimeField()),
                ('disponivel',
                 models.BooleanField(default=True,
                                     editable=False,
                                     verbose_name='disponível')),
                ('agenda',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   related_name='horarios',
                                   to='app.Agenda')),
            ],
            options={
                'ordering': ['horario'],
                'unique_together': {('agenda', 'horario')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='agenda',
            unique_together={('medico', 'dia')},
        ),
    ]
コード例 #21
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('age', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(max_length=150,
                                  unique=True,
                                  verbose_name='username')),
                ('email',
                 models.EmailField(max_length=254, verbose_name='email')),
                ('is_staff',
                 models.BooleanField(default=False, verbose_name='is_staff')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='active')),
                ('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',
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
    ]
コード例 #22
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Pergunta',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('titulo',
                 models.CharField(max_length=200, verbose_name='Título')),
                ('detalhesPergunta',
                 models.CharField(max_length=5000, verbose_name='Detalhes')),
                ('data_criacao',
                 models.DateField(auto_now=True, verbose_name='Criação')),
            ],
        ),
        migrations.CreateModel(
            name='Projeto',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('data_vencimento',
                 models.DateField(null=True, verbose_name='Concluir até:')),
                ('detalhes',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=200,
                                  verbose_name='Descrição')),
            ],
        ),
        migrations.CreateModel(
            name='Resposta',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('conteudo',
                 models.CharField(max_length=5000, verbose_name='Resposta')),
                ('data_criacao',
                 models.DateTimeField(auto_now=True, verbose_name='Criação')),
                ('like', models.IntegerField()),
                ('deslike', models.IntegerField()),
                ('pergunta',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Pergunta')),
            ],
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Status',
            },
        ),
        migrations.CreateModel(
            name='Tarefa',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('descricao',
                 models.CharField(max_length=200, verbose_name='Descrição')),
                ('data_criacao', models.DateField(auto_now=True)),
                ('data_vencimento',
                 models.DateField(null=True,
                                  verbose_name='Data de Vencimento')),
                ('projeto',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Projeto')),
                ('status',
                 models.ForeignKey(blank=True,
                                   default=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Status')),
            ],
        ),
        migrations.CreateModel(
            name='Usuario',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nomeCompleto',
                 models.CharField(max_length=50,
                                  verbose_name='Nome Completo')),
                ('nomeUsuario',
                 models.CharField(max_length=50, verbose_name='Usuario')),
                ('email', models.EmailField(max_length=50)),
                ('senha', models.CharField(max_length=50)),
                ('avatar',
                 models.ImageField(blank=True,
                                   upload_to=app.models.uploac_location,
                                   verbose_name='Foto do perfil')),
            ],
        ),
        migrations.AddField(
            model_name='resposta',
            name='usuario',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.Usuario'),
        ),
        migrations.AddField(
            model_name='projeto',
            name='status',
            field=models.ForeignKey(
                blank=True,
                default=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='app.Status'),
        ),
        migrations.AddField(
            model_name='projeto',
            name='usuario',
            field=models.ForeignKey(
                blank=True,
                default=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='app.Usuario'),
        ),
        migrations.AddField(
            model_name='pergunta',
            name='usuario',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='app.Usuario'),
        ),
    ]
コード例 #23
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('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', app.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='HistoricalPrinter',
            fields=[
                ('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('auth_token', models.CharField(db_index=True, max_length=28)),
                ('current_print_filename', models.CharField(blank=True, max_length=1000, null=True)),
                ('current_print_started_at', models.DateTimeField(null=True)),
                ('current_print_alerted_at', models.DateTimeField(null=True)),
                ('current_print_alert_muted', models.BooleanField(default=False)),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical printer',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='Printer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('auth_token', models.CharField(max_length=28, unique=True)),
                ('current_print_filename', models.CharField(blank=True, max_length=1000, null=True)),
                ('current_print_started_at', models.DateTimeField(null=True)),
                ('current_print_alerted_at', models.DateTimeField(null=True)),
                ('current_print_alert_muted', models.BooleanField(default=False)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PrinterCommand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('command', models.CharField(max_length=2000)),
                ('status', models.CharField(choices=[('PENDING', 'pending'), ('SENT', 'sent')], default='PENDING', max_length=10)),
                ('printer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Printer')),
            ],
        ),
    ]
コード例 #24
0
ファイル: 0001_initial.py プロジェクト: Rogerio11/Real-state
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Locataire',
            fields=[
                ('numLocataire',
                 models.AutoField(primary_key=True, serialize=False)),
                ('nomLocataire', models.CharField(max_length=150)),
                ('prenomLocataire', models.CharField(max_length=150)),
                ('telephoneLocataire', models.IntegerField()),
                ('mailLocataire', models.EmailField(max_length=150)),
                ('profession', models.CharField(max_length=150)),
                ('created_by',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'locataire',
            },
        ),
        migrations.CreateModel(
            name='Logement',
            fields=[
                ('numLogement',
                 models.AutoField(primary_key=True, serialize=False)),
                ('typeL',
                 models.CharField(choices=[
                     ('T1 avec cuisine non séparée', 'Studio'),
                     ('1 pièce principale (à la fois chambre et salon) + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T1'),
                     ('2 pièces (1 chambre + 1 salon) + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T2'),
                     ('2 pièces (1 chambre + 1 salon) dont l’une est suffisamment grande pour être séparée en deux zones distinctes + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T2 Bis'),
                     ('3 pièces (2 chambres + 1 salon) + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T3'),
                     (' 3 pièces (2 chambres + 1 salon) dont l’une est suffisamment grande pour être séparée en deux zones distinctes + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T3 Bis'),
                     ('4 pièces (3 chambres + 1 salon/séjour OU 2 chambres + 1 salon + 1 salle à manger) + 1 cuisine + 1 salle de bains (avec WC séparés ou inclus)',
                      'T4'),
                     (' T4 transformé en T3 en réunissant deux pièces pour en faire 1 grande',
                      'T3 T4'),
                     (' 5 pièces (4 chambres + 1 salon/séjour OU 3 chambres + 1 salon + 1 salle à manger) + 1 cuisine + 1 salle de bains ou + (avec WC séparés ou inclus)',
                      'T5')
                 ],
                                  max_length=200)),
                ('superficie', models.IntegerField()),
                ('loyer', models.IntegerField()),
                ('photoL1',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Logement.upload_path)),
                ('photoL2',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Logement.upload_path)),
                ('photoL3',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Logement.upload_path)),
            ],
            options={
                'db_table': 'logement',
            },
        ),
        migrations.CreateModel(
            name='Paiement',
            fields=[
                ('idPaiement',
                 models.AutoField(primary_key=True, serialize=False)),
                ('montantP', models.IntegerField()),
                ('datePaie', models.DateTimeField(auto_now_add=True)),
                ('numLocataire',
                 models.ForeignKey(db_column='numLocataire',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Locataire')),
                ('numLogement',
                 models.ForeignKey(db_column='numLogement',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Logement')),
            ],
            options={
                'db_table': 'paiement',
            },
        ),
        migrations.CreateModel(
            name='Maison',
            fields=[
                ('numM', models.AutoField(primary_key=True, serialize=False)),
                ('nomM', models.CharField(blank=True, max_length=150)),
                ('numRueM', models.IntegerField()),
                ('adresseM', models.CharField(max_length=150)),
                ('codePostalM', models.CharField(max_length=5)),
                ('villeM', models.CharField(max_length=150)),
                ('photoM1',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Maison.upload_path)),
                ('photoM2',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Maison.upload_path)),
                ('photoM3',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=app.models.Maison.upload_path)),
                ('numP',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'maison',
            },
        ),
        migrations.AddField(
            model_name='logement',
            name='numM',
            field=models.ForeignKey(
                db_column='numM',
                on_delete=django.db.models.deletion.CASCADE,
                to='app.Maison'),
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('idLocation',
                 models.AutoField(primary_key=True, serialize=False)),
                ('dateDebut', models.DateField()),
                ('dateFin', models.DateField()),
                ('numLocataire',
                 models.ForeignKey(db_column='numLocataire',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Locataire')),
                ('numLogement',
                 models.ForeignKey(db_column='numLogement',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Logement')),
            ],
            options={
                'db_table': 'location',
            },
        ),
        migrations.CreateModel(
            name='Depenser',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('montantD', models.IntegerField()),
                ('dateD', models.DateTimeField(auto_now_add=True)),
                ('descriptionD', models.CharField(max_length=300)),
                ('numLogement',
                 models.ForeignKey(db_column='numLogement',
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Logement')),
                ('numP',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'depenser',
            },
        ),
    ]
コード例 #25
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Dataset',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('params', models.TextField(verbose_name='params')),
                ('type',
                 models.CharField(choices=[('f', 'File'), ('d', 'Database'),
                                           ('a', 'API')],
                                  max_length=1)),
            ],
            options={
                'abstract': False,
            },
        ),
        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')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('name', models.CharField(max_length=50)),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='active')),
                ('avatar',
                 models.ImageField(blank=True, null=True,
                                   upload_to='avatars/')),
                ('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',
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
    ]
コード例 #26
0
ファイル: 0001_initial.py プロジェクト: dexpjar/cabd
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='App',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('taskcode',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='TaskCode')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Description')),
                ('citation',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Citation')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app.models.image_upload_location,
                                   verbose_name='Image')),
                ('command',
                 models.CharField(max_length=100, verbose_name='Command')),
                ('app_compatibility',
                 models.ManyToManyField(
                     blank=True,
                     related_name='_app_app_compatibility_+',
                     to='app.App')),
            ],
        ),
        migrations.CreateModel(
            name='ImageSlideshow',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=app.models.image_upload_location,
                                   verbose_name='Image')),
                ('title', models.CharField(max_length=100,
                                           verbose_name='Title')),
            ],
        ),
        migrations.CreateModel(
            name='MyCompany',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('logo',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app.models.image_upload_location,
                                   verbose_name='Logo')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('address', models.TextField(blank=True,
                                             verbose_name='Address')),
                ('phone',
                 models.CharField(blank=True,
                                  max_length=9,
                                  verbose_name='Phone')),
                ('email',
                 models.EmailField(max_length=254, verbose_name='Email')),
                ('citations', models.TextField(verbose_name='Citations')),
            ],
        ),
        migrations.CreateModel(
            name='ParamsInput',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('state',
                 models.CharField(choices=[('text', 'Text'), ('file', 'File')],
                                  default='text',
                                  max_length=15)),
                ('allowed_format',
                 models.CharField(max_length=100,
                                  verbose_name='Allowed Format')),
                ('app',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='param_app',
                                   to='app.App')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('institution',
                 models.CharField(blank=True,
                                  max_length=100,
                                  null=True,
                                  verbose_name='Institution')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['user'],
                'verbose_name': 'Profile',
                'verbose_name_plural': 'Profiles',
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100,
                                           verbose_name='Title')),
                ('description', models.TextField(verbose_name='Section')),
                ('app',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.App')),
                ('subsection',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Section')),
            ],
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name')),
                ('state',
                 models.CharField(choices=[('pending', 'Pending'),
                                           ('in_queue', 'In Queue'),
                                           ('completed', 'Completed'),
                                           ('canceled', 'Canceled')],
                                  default='pending',
                                  max_length=15)),
                ('creation_date',
                 models.DateTimeField(auto_now_add=True,
                                      verbose_name='Creation Date')),
                ('file_input',
                 models.FileField(upload_to='files/input/',
                                  verbose_name='File Input')),
                ('file_output',
                 models.FileField(blank=True,
                                  upload_to='files/output/',
                                  verbose_name='File Output')),
                ('app',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='application',
                                   to='app.App')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #27
0
ファイル: 0001_initial.py プロジェクト: Execut3/Held-CTF
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     help_text=
                     'باید شامل حرف، عدد و کاراکترهای @ . + - _  بوده و نباید تعداد کاراکترها بیش از ۳۰ باشد.',
                     max_length=30,
                     unique=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             re.compile('^[\\w.@+-]+$', 32),
                             'Enter a valid username.', 'invalid')
                     ],
                     verbose_name='نام کاربری')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='نام')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  null=True,
                                  verbose_name='نام خانوادگی')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=255,
                                   null=True,
                                   verbose_name='آدرس ایمیل')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'نشان می\u200cدهد که آیا این کاربر می\u200cتواند وارد این وبگاه مدیریت شود یا خیر.',
                     verbose_name='وضعیت کارمندی')),
                ('is_active',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether this user should be treated as active. Deselect this instead of deleting accounts.',
                     verbose_name='فعال')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='تاریخ پیوستن')),
                ('receive_newsletter',
                 models.BooleanField(default=False,
                                     verbose_name='receive newsletter')),
                ('avatar',
                 models.ImageField(
                     blank=True,
                     max_length=1500,
                     null=True,
                     upload_to=app.models.avatar_images_upload_address)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'کاربر',
                'verbose_name_plural': 'کاربرها',
            },
        ),
    ]
コード例 #28
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BoardPositions',
            fields=[
                ('title',
                 models.CharField(default=b'The Title',
                                  max_length=100,
                                  primary_key=True,
                                  serialize=False)),
                ('order', models.IntegerField(default=100)),
            ],
            options={
                'ordering': ['order'],
                'verbose_name_plural': 'Board Positions',
            },
        ),
        migrations.CreateModel(
            name='CalendarHolidays',
            fields=[
                ('name',
                 models.CharField(max_length=120,
                                  primary_key=True,
                                  serialize=False)),
                ('date', models.DateField(default=django.utils.timezone.now)),
            ],
            options={
                'verbose_name_plural': 'Calendar Holidays',
            },
        ),
        migrations.CreateModel(
            name='CommitteeChairPositions',
            fields=[
                ('title',
                 models.CharField(default=b'The Title',
                                  max_length=100,
                                  primary_key=True,
                                  serialize=False)),
                ('order', models.IntegerField(default=100)),
            ],
            options={
                'ordering': ['order'],
                'verbose_name_plural': 'Committee Chair Positions',
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(default=b'Event Name',
                                          max_length=100)),
                ('start_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('end_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('start_time',
                 app.models.TwelveHourTimeField(
                     default=django.utils.timezone.now)),
                ('end_time',
                 models.TimeField(blank=True,
                                  default=django.utils.timezone.now)),
                ('location',
                 models.CharField(blank=True,
                                  choices=[(b'LA', b'USLA Pavilion'),
                                           (b'LB', b'Irwin Inn Beach'),
                                           (b'LC', b"Crowe's Landing Docks"),
                                           (b'LD', b'Multiple'),
                                           (b'LE', None)],
                                  max_length=2)),
                ('unique_location', models.CharField(blank=True,
                                                     max_length=100)),
                ('cost', models.IntegerField(default=0)),
                ('cost_has_hst', models.BooleanField(default=True)),
                ('is_annual_event', models.BooleanField(default=False)),
                ('image',
                 models.ImageField(blank=True, upload_to=b'images/events/')),
                ('pdf_file',
                 models.FileField(blank=True, upload_to=b'files/events/')),
                ('description', models.TextField(blank=True)),
                ('contact_email', models.EmailField(blank=True,
                                                    max_length=254)),
            ],
            options={
                'ordering': ['start_date', 'start_time'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EventGalleryImages',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(blank=True, max_length=140)),
                ('date', models.DateField(blank=True, default=None,
                                          null=True)),
                ('image',
                 models.ImageField(
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('image_thumb',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FrontPageLinks',
            fields=[
                ('url', models.URLField(primary_key=True, serialize=False)),
                ('link_text', models.CharField(max_length=60)),
            ],
            options={
                'verbose_name_plural': 'Front Page Links',
            },
        ),
        migrations.CreateModel(
            name='MembershipSettings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('pdf_file', models.FileField(blank=True,
                                              upload_to=b'files/')),
            ],
            options={
                'verbose_name_plural': 'Membership Settings',
            },
        ),
        migrations.CreateModel(
            name='NewsItem',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=120)),
                ('description', models.TextField(blank=True)),
                ('publish_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('contact_name',
                 models.CharField(blank=True, max_length=80, null=True)),
                ('contact_email',
                 models.EmailField(blank=True, max_length=254, null=True)),
                ('contact_tel',
                 models.CharField(blank=True,
                                  max_length=16,
                                  null=True,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message=b'Phone number invalid.',
                                          regex=b'^\\+?1?[\\d-]{9,18}$')
                                  ])),
                ('pdf_file',
                 models.FileField(
                     blank=True,
                     upload_to=app.models.get_upload_news_item_to_files)),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_news_item_to_images)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('board_news',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.BoardPositions')),
                ('committee_news',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.CommitteeChairPositions')),
            ],
        ),
        migrations.CreateModel(
            name='NewsTopics',
            fields=[
                ('name',
                 models.CharField(max_length=40,
                                  primary_key=True,
                                  serialize=False)),
            ],
            options={
                'verbose_name_plural': 'News Topics',
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('title_text',
                 models.CharField(default=b'The Title',
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False)),
                ('slug',
                 models.CharField(blank=True,
                                  default=b'url',
                                  editable=False,
                                  max_length=50)),
                ('fa_icon', models.CharField(blank=True, max_length=30)),
                ('sub_description',
                 models.CharField(default=b'The Title Description',
                                  max_length=100)),
                ('image',
                 models.ImageField(upload_to=app.models.get_upload_to_pages)),
                ('description', models.TextField(default=b'Page Description')),
                ('page_order', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Program',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name',
                 models.CharField(default=b'UNIQUE_NAME',
                                  max_length=50,
                                  unique=True)),
                ('description', models.TextField(blank=True)),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_program_to_images)),
                ('pdf_file',
                 models.FileField(
                     blank=True,
                     upload_to=app.models.get_upload_program_to_files)),
                ('pdf_link_name',
                 models.CharField(blank=True, max_length=40, null=True)),
                ('fa_icon', models.CharField(blank=True, max_length=30)),
                ('start_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('end_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('sub_description', models.TextField(blank=True)),
                ('contact_name', models.CharField(blank=True, max_length=100)),
                ('contact_email', models.EmailField(blank=True,
                                                    max_length=254)),
                ('contact_tel', models.CharField(blank=True, max_length=16)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='ProgramEvent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(default=b'Event Name',
                                          max_length=100)),
                ('start_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('end_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('start_time',
                 app.models.TwelveHourTimeField(
                     default=django.utils.timezone.now)),
                ('end_time',
                 models.TimeField(blank=True,
                                  default=django.utils.timezone.now)),
                ('location',
                 models.CharField(blank=True,
                                  choices=[(b'LA', b'USLA Pavilion'),
                                           (b'LB', b'Irwin Inn Beach'),
                                           (b'LC', b"Crowe's Landing Docks"),
                                           (b'LD', b'Multiple'),
                                           (b'LE', None)],
                                  max_length=2)),
                ('unique_location', models.CharField(blank=True,
                                                     max_length=100)),
                ('cost', models.IntegerField(default=0)),
                ('cost_has_hst', models.BooleanField(default=True)),
                ('is_annual_event', models.BooleanField(default=False)),
                ('image',
                 models.ImageField(blank=True, upload_to=b'images/events/')),
                ('pdf_file',
                 models.FileField(blank=True, upload_to=b'files/events/')),
                ('description', models.TextField(blank=True)),
                ('contact_email', models.EmailField(blank=True,
                                                    max_length=254)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('program',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Program',
                                   to_field=b'name')),
            ],
            options={
                'ordering': ['start_date', 'start_time'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProgramGallery',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=140)),
                ('slug',
                 models.CharField(blank=True,
                                  default=b'url',
                                  editable=False,
                                  max_length=50)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('type',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Program')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProgramGalleryImages',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(blank=True, max_length=140)),
                ('date', models.DateField(blank=True, default=None,
                                          null=True)),
                ('image',
                 models.ImageField(
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('image_thumb',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('gallery',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.ProgramGallery')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProgramSchedule',
            fields=[
                ('total_available_spaces',
                 models.PositiveIntegerField(default=0)),
                ('total_reserved_spaces',
                 models.PositiveIntegerField(default=0)),
                ('start_time',
                 models.TimeField(default=django.utils.timezone.now)),
                ('end_time',
                 models.TimeField(default=django.utils.timezone.now)),
                ('monday', models.BooleanField(default=False)),
                ('tuesday', models.BooleanField(default=False)),
                ('wednesday', models.BooleanField(default=False)),
                ('thursday', models.BooleanField(default=False)),
                ('friday', models.BooleanField(default=False)),
                ('saturday', models.BooleanField(default=False)),
                ('sunday', models.BooleanField(default=False)),
                ('name',
                 models.CharField(default=b' Name',
                                  max_length=60,
                                  primary_key=True,
                                  serialize=False)),
                ('location',
                 models.CharField(blank=True,
                                  choices=[(b'LA', b'USLA Pavilion'),
                                           (b'LB', b'Irwin Inn Beach'),
                                           (b'LC', b"Crowe's Landing Docks"),
                                           (b'LD', b'Multiple'),
                                           (b'LE', None)],
                                  max_length=2)),
                ('note', models.CharField(blank=True, max_length=200)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('program',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Program')),
            ],
            options={
                'ordering': ['start_time'],
            },
        ),
        migrations.CreateModel(
            name='SiteMemberProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email_forward', models.EmailField(max_length=254)),
                ('tel_num',
                 models.CharField(blank=True,
                                  max_length=16,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message=b'Phone number invalid.',
                                          regex=b'^\\+?1?[\\d-]{9,18}$')
                                  ])),
                ('cel_num',
                 models.CharField(blank=True,
                                  max_length=16,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message=b'Phone number invalid.',
                                          regex=b'^\\+?1?[\\d-]{9,18}$')
                                  ])),
                ('image',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_usla_membership_images)),
                ('board_member',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.BoardPositions')),
                ('committee_member',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.CommitteeChairPositions')),
                ('user',
                 models.OneToOneField(
                     blank=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SiteSettings',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('site_name', models.CharField(default=b'usla',
                                               max_length=40)),
                ('site_desc', models.CharField(default=b'', max_length=80)),
                ('site_history', models.TextField(blank=True)),
                ('site_history_lbl', models.CharField(blank=True,
                                                      max_length=80)),
                ('contact',
                 models.EmailField(default=b'*****@*****.**', max_length=254)),
                ('facebook_link', models.URLField(blank=True)),
                ('logo_header_image',
                 models.ImageField(blank=True, upload_to=b'images/site/')),
                ('logo_btm_image',
                 models.ImageField(blank=True, upload_to=b'images/site/')),
            ],
            options={
                'verbose_name_plural': ' Site Settings',
            },
        ),
        migrations.CreateModel(
            name='USLAGallery',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=140)),
                ('slug',
                 models.CharField(blank=True,
                                  default=b'url',
                                  editable=False,
                                  max_length=50)),
                ('name', models.CharField(max_length=140, unique=True)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='USLAGalleryImages',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('description', models.CharField(blank=True, max_length=140)),
                ('date', models.DateField(blank=True, default=None,
                                          null=True)),
                ('image',
                 models.ImageField(
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('image_thumb',
                 models.ImageField(
                     blank=True,
                     upload_to=app.models.get_upload_gallery_image_to_images)),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('gallery',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.USLAGallery')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UslaLocations',
            fields=[
                ('name',
                 models.CharField(default=b'The Location Name',
                                  max_length=50,
                                  primary_key=True,
                                  serialize=False)),
                ('short_name',
                 models.CharField(default=b'Abrv', max_length=2, unique=True)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name_plural': 'USLA Locations',
            },
        ),
        migrations.CreateModel(
            name='EventGallery',
            fields=[
                ('description', models.CharField(blank=True, max_length=140)),
                ('slug',
                 models.CharField(blank=True,
                                  default=b'url',
                                  editable=False,
                                  max_length=50)),
                ('type',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     primary_key=True,
                     serialize=False,
                     to='app.Event')),
                ('author',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Event Galeries',
            },
        ),
        migrations.AddField(
            model_name='newsitem',
            name='general_news',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='app.NewsTopics'),
        ),
        migrations.AddField(
            model_name='event',
            name='author',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='eventgalleryimages',
            name='gallery',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.EventGallery'),
        ),
    ]
コード例 #29
0
ファイル: 0001_initial.py プロジェクト: enesSerkanGulec/kamu
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')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('kurum',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name='Kurum')),
                ('kurum_adres',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='Kurum adresi')),
                ('kurum_telefon',
                 models.CharField(
                     max_length=17,
                     null=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Telefon numarası şu şeklillerden biri gibi olmalı: '+9999999999' veya '9999999999' veya '999 9999999' veya '999 999 9999' veya '999 999 99 99'.",
                             regex=
                             '^\\+?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{2} ?[0-9]{2}$'
                         )
                     ],
                     verbose_name='Kurum telefonu')),
                ('kurum_web_adres',
                 models.URLField(null=True, verbose_name='Kurum web adresi')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', app.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='il',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('adi', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='ilan',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ad',
                 models.CharField(max_length=40,
                                  null=True,
                                  verbose_name='ilan adı')),
                ('adet',
                 models.IntegerField(default=1, null=True,
                                     verbose_name='Adet')),
                ('aciklama',
                 models.TextField(blank=True, verbose_name='Açıklama')),
                ('yayinda',
                 models.BooleanField(default=True, verbose_name='Yayında')),
                ('olusturma_tarihi', models.DateField(auto_now=True)),
                ('silme_tarihi', models.DateField(blank=True, null=True)),
                ('kurum',
                 models.CharField(blank=True, max_length=200, null=True)),
                ('kucuk_resim',
                 models.ImageField(blank=True,
                                   editable=False,
                                   null=True,
                                   upload_to='silinenilanlar')),
            ],
        ),
        migrations.CreateModel(
            name='ilce',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('adi', models.CharField(max_length=35)),
                ('ill',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.il')),
            ],
        ),
        migrations.CreateModel(
            name='Resim',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('resim',
                 models.ImageField(null=True,
                                   upload_to='',
                                   verbose_name='Resim')),
                ('kucukResim',
                 models.ImageField(blank=True,
                                   editable=False,
                                   null=True,
                                   upload_to='thumbs')),
                ('ilan',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.ilan')),
            ],
            options={
                'ordering': ['ilan'],
            },
        ),
        migrations.CreateModel(
            name='Mesajlar',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('yon',
                 models.CharField(choices=[('gelen', 'gelen'),
                                           ('giden', 'giden')],
                                  default='gelen',
                                  max_length=5)),
                ('mesaj_metni', models.TextField(default='')),
                ('tarih', models.DateTimeField(auto_now_add=True)),
                ('okundu', models.BooleanField(default=False)),
                ('ilan',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.ilan')),
            ],
        ),
        migrations.CreateModel(
            name='mahalle',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('adi', models.CharField(max_length=50)),
                ('ilcee',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.ilce')),
            ],
        ),
        migrations.CreateModel(
            name='KayitBekleyenler',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='Kurum e-posta adresi')),
                ('kurum',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name='Kurum adı')),
                ('kurum_adres',
                 models.CharField(max_length=200,
                                  null=True,
                                  verbose_name='Kurum adresi')),
                ('kurum_telefon',
                 models.CharField(
                     max_length=17,
                     null=True,
                     validators=[
                         django.core.validators.RegexValidator(
                             message=
                             "Telefon numarası şu şeklillerden biri gibi olmalı: '+9999999999' veya '9999999999' veya '999 9999999' veya '999 999 9999' veya '999 999 99 99'. ",
                             regex=
                             '^\\+?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{2} ?[0-9]{2}$'
                         )
                     ],
                     verbose_name='Kurum telefonu')),
                ('kurum_web_adres',
                 models.URLField(blank=True,
                                 null=True,
                                 verbose_name='Kurum web adresi')),
                ('kurum_il',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   to='app.il')),
                ('kurum_ilce',
                 smart_selects.db_fields.ChainedForeignKey(
                     chained_field='kurum_il',
                     chained_model_field='ill',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='app.ilce')),
            ],
        ),
        migrations.CreateModel(
            name='Kategori',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ad',
                 models.CharField(max_length=20, verbose_name='Kategori adı')),
                ('ust_kategori',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Kategori')),
            ],
            options={
                'ordering': ('ust_kategori__ad', 'ad'),
            },
        ),
        migrations.AddField(
            model_name='ilan',
            name='kategori',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='app.Kategori'),
        ),
        migrations.AddField(
            model_name='ilan',
            name='sahip',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to=settings.AUTH_USER_MODEL),
        ),
        migrations.CreateModel(
            name='favoriler',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('ilan',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.ilan')),
                ('sahip',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='kurum_il',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='app.il'),
        ),
        migrations.AddField(
            model_name='user',
            name='kurum_ilce',
            field=smart_selects.db_fields.ChainedForeignKey(
                auto_choose=True,
                chained_field='kurum_il',
                chained_model_field='ill',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                sort=False,
                to='app.ilce'),
        ),
        migrations.AddField(
            model_name='user',
            name='kurum_mahalle',
            field=smart_selects.db_fields.ChainedForeignKey(
                auto_choose=True,
                chained_field='kurum_ilce',
                chained_model_field='ilcee',
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                sort=False,
                to='app.mahalle'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(
                blank=True,
                help_text='Specific permissions for this user.',
                related_name='user_set',
                related_query_name='user',
                to='auth.Permission',
                verbose_name='user permissions'),
        ),
    ]
コード例 #30
0
ファイル: 0001_initial.py プロジェクト: jz5jx/quickTutor
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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('username', models.CharField(default='None', max_length=15)),
                ('description', models.CharField(default='New User', max_length=200)),
                ('image', models.ImageField(default='default.jpg', upload_to='profile_pics')),
                ('has_active_request', models.BooleanField(default=False)),
                ('reviewable_tutor', models.CharField(default='None', max_length=100)),
                ('reviewable_tutee', models.CharField(default='None', max_length=100)),
                ('contacts', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
                ('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', app.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=500)),
                ('rating', models.IntegerField()),
                ('reviewee', models.CharField(max_length=100)),
                ('reviewer', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('location', models.CharField(max_length=200)),
                ('pub_date', models.DateTimeField(max_length=100, verbose_name='date published')),
                ('description', models.CharField(max_length=1000)),
                ('user', models.CharField(max_length=100)),
                ('tutors', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.CharField(max_length=1000)),
                ('timestamp', models.DateTimeField(verbose_name='timestamp')),
                ('receiver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='receiver', to=settings.AUTH_USER_MODEL)),
                ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sender', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Conversation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('messages', models.ManyToManyField(to='app.Message')),
                ('participants', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]