コード例 #1
0
ファイル: models.py プロジェクト: rogeriofalcone/django-sis
class AdmissionLevel(models.Model):
    name = models.CharField(max_length=255,
                            unique=True,
                            validators=[
                                RegexValidator(r'^[a-zA-Z0-9- ]*$',
                                               message='Must be Alphanumeric')
                            ])
    order = models.IntegerField(
        unique=True, help_text="Order in which level appears, 1 being first.")

    def __unicode__(self):
        return unicode(self.name)

    def edit(self):
        return "Edit"

    def show_checks(self):
        """Show checks needed for this level"""
        msg = '|'
        for check in self.admissioncheck_set.all():
            msg += "%s | " % (check.name, )
        return msg

    class Meta:
        ordering = ('order', )
コード例 #2
0
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",
                    ),
                ),
                (
                    "uuid",
                    models.UUIDField(default=uuid.uuid4, verbose_name="identifier"),
                ),
                ("username", models.EmailField(max_length=254, unique=True)),
                ("given_name", models.CharField(max_length=255)),
                ("middle_name", models.CharField(blank=True, max_length=255)),
                ("family_name", models.CharField(max_length=255)),
                ("_identicon", models.TextField(verbose_name="identicon")),
                ("is_active", models.BooleanField(default=False)),
                ("is_staff", models.BooleanField(default=False)),
                (
                    "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={
                "permissions": (
                    ("can_create", "Can Create"),
                    ("can_view", "Can View"),
                    ("can_edit", "Can Edit"),
                    ("can_remove", "Can Remove"),
                    ("can_view_permissions", "Can View Permissions"),
                    ("can_edit_permissions", "Can Edit Permissions"),
                )
            },
            bases=(models.Model, guardian.mixins.GuardianUserMixin),
        ),
        migrations.CreateModel(
            name="DemographicData",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "uuid",
                    models.UUIDField(default=uuid.uuid4, verbose_name="identifier"),
                ),
                (
                    "number_of_children",
                    models.CharField(
                        choices=[
                            ("0", "0"),
                            ("1", "1"),
                            ("2", "2"),
                            ("3", "3"),
                            ("4", "4"),
                            ("5", "5"),
                            ("6", "6"),
                            ("7", "7"),
                            ("8", "8"),
                            ("9", "9"),
                            ("10", "10"),
                            (">10", "More than 10"),
                        ],
                        max_length=3,
                    ),
                ),
                (
                    "child_birthdays",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=models.DateField(),
                        size=None,
                        verbose_name="children's birthdays",
                    ),
                ),
                (
                    "languages_spoken_at_home",
                    models.TextField(verbose_name="languages spoken at home"),
                ),
                (
                    "number_of_guardians",
                    models.CharField(
                        choices=[
                            ("1", "1"),
                            ("2", "2"),
                            ("3>", "3 or more"),
                            ("varies", "varies"),
                        ],
                        max_length=6,
                    ),
                ),
                ("number_of_guardians_explanation", models.TextField()),
                (
                    "race_identification",
                    models.CharField(
                        choices=[
                            ("white", "White"),
                            ("hisp", "Hispanic, Latino, or Spanish origin"),
                            ("black", "Black or African American"),
                            ("asian", "Asian"),
                            ("native", "American Indian or Alaska Native"),
                            ("mideast-naf", "Middle Eastern or North African"),
                            (
                                "hawaiian-pac-isl",
                                "Native Hawaiian or Other Pacific Islander",
                            ),
                            ("other", "Another race, ethnicity, or origin"),
                        ],
                        max_length=16,
                    ),
                ),
                (
                    "age",
                    models.CharField(
                        choices=[
                            ("<18", "under 18"),
                            ("18-21", "18-21"),
                            ("22-24", "22-24"),
                            ("25-29", "25-29"),
                            ("30-34", "30-34"),
                            ("35-39", "35-39"),
                            ("40-44", "40-44"),
                            ("45-59", "45-49"),
                            ("50s", "50-59"),
                            ("60s", "60-69"),
                            (">70", "70 or over"),
                        ],
                        max_length=5,
                    ),
                ),
                (
                    "gender",
                    models.CharField(
                        choices=[
                            ("m", "male"),
                            ("f", "female"),
                            ("o", "other"),
                            ("na", "prefer not to answer"),
                        ],
                        max_length=2,
                    ),
                ),
                (
                    "education_level",
                    models.CharField(
                        choices=[
                            ("some", "some or attending high school"),
                            ("hs", "high school diploma or GED"),
                            ("col", "some or attending college"),
                            ("assoc", "2-year college degree"),
                            ("bach", "4-year college degree"),
                            (
                                "grad",
                                "some or attending graduate or professional school",
                            ),
                            ("prof", "graduate or professional degree"),
                        ],
                        max_length=5,
                    ),
                ),
                (
                    "spouse_education_level",
                    models.CharField(
                        choices=[
                            ("some", "some or attending high school"),
                            ("hs", "high school diploma or GED"),
                            ("col", "some or attending college"),
                            ("assoc", "2-year college degree"),
                            ("bach", "4-year college degree"),
                            (
                                "grad",
                                "some or attending graduate or professional school",
                            ),
                            ("prof", "graduate or professional degree"),
                            ("na", "not applicable - no spouse or partner"),
                        ],
                        max_length=5,
                    ),
                ),
                (
                    "annual_income",
                    models.CharField(
                        choices=[
                            ("0", "0"),
                            ("5000", "5000"),
                            ("10000", "10000"),
                            ("15000", "15000"),
                            ("20000", "20000"),
                            ("30000", "30000"),
                            ("40000", "40000"),
                            ("50000", "50000"),
                            ("60000", "60000"),
                            ("70000", "70000"),
                            ("80000", "80000"),
                            ("90000", "90000"),
                            ("100000", "100000"),
                            ("110000", "110000"),
                            ("120000", "120000"),
                            ("130000", "130000"),
                            ("140000", "140000"),
                            ("150000", "150000"),
                            ("160000", "160000"),
                            ("170000", "170000"),
                            ("180000", "180000"),
                            ("190000", "190000"),
                            (">200000", "over 200000"),
                            ("na", "prefer not to answer"),
                        ],
                        max_length=7,
                    ),
                ),
                ("number_of_books", models.IntegerField()),
                ("additional_comments", models.TextField()),
                ("country", django_countries.fields.CountryField(max_length=2)),
                ("state", localflavor.us.models.USStateField(max_length=2)),
                (
                    "density",
                    models.CharField(
                        choices=[
                            ("urban", "urban"),
                            ("suburban", "suburban"),
                            ("rural", "rural"),
                        ],
                        max_length=8,
                    ),
                ),
                (
                    "extra",
                    project.fields.datetime_aware_jsonfield.DateTimeAwareJSONField(
                        null=True
                    ),
                ),
                (
                    "previous",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="next_demographic_data",
                        related_query_name="next_demographic_data",
                        to="accounts.DemographicData",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="demographics",
                        related_query_name="demographics",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Organization",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("url", models.URLField(verbose_name="Website")),
            ],
            options={
                "permissions": (
                    ("can_view", "Can View"),
                    ("can_edit", "Can Edit"),
                    ("can_create", "Can Create"),
                    ("can_remove", "Can Remove"),
                )
            },
        ),
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "uuid",
                    models.UUIDField(default=uuid.uuid4, verbose_name="identifier"),
                ),
                ("given_name", models.CharField(max_length=255)),
                ("birthday", models.DateField()),
                (
                    "gender",
                    models.CharField(
                        choices=[
                            ("m", "male"),
                            ("f", "female"),
                            ("o", "other"),
                            ("na", "prefer not to answer"),
                        ],
                        max_length=2,
                    ),
                ),
                ("age_at_birth", models.CharField(max_length=25)),
                ("additional_information", models.TextField()),
                ("deleted", models.BooleanField(default=False)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="profiles",
                        related_query_name="profiles",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="user",
            name="organization",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="users",
                related_query_name="user",
                to="accounts.Organization",
            ),
        ),
        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",
            ),
        ),
    ]
コード例 #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ABARating',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('year_rated',
                 models.PositiveSmallIntegerField(
                     help_text='The year of the rating.', null=True)),
                ('rating',
                 models.CharField(choices=[
                     ('ewq', 'Exceptionally Well Qualified'),
                     ('wq', 'Well Qualified'), ('q', 'Qualified'),
                     ('nq', 'Not Qualified'),
                     ('nqa', 'Not Qualified By Reason of Age')
                 ],
                                  help_text='The rating given to the person.',
                                  max_length=5)),
            ],
            options={
                'verbose_name': 'American Bar Association Rating',
                'verbose_name_plural': 'American Bar Association Ratings',
            },
        ),
        migrations.CreateModel(
            name='Attorney',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('name',
                 models.TextField(db_index=True,
                                  help_text='The name of the attorney.')),
                ('contact_raw',
                 models.TextField(
                     help_text='The raw contents of the contact field')),
                ('phone',
                 models.CharField(
                     blank=True,
                     help_text='The phone number of the attorney.',
                     max_length=20)),
                ('fax',
                 models.CharField(blank=True,
                                  help_text='The fax number of the attorney.',
                                  max_length=20)),
                ('email',
                 models.EmailField(
                     blank=True,
                     help_text='The email address of the attorney.',
                     max_length=254)),
            ],
            options={
                'permissions':
                (('has_recap_api_access', 'Can work with RECAP API'), ),
            },
        ),
        migrations.CreateModel(
            name='AttorneyOrganization',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('lookup_key',
                 models.TextField(
                     db_index=True,
                     help_text=
                     'A trimmed version of the address for duplicate matching.',
                     unique=True)),
                ('name',
                 models.TextField(db_index=True,
                                  help_text='The name of the organization.')),
                ('address1',
                 models.TextField(
                     db_index=True,
                     help_text='The normalized address1 of the organization')),
                ('address2',
                 models.TextField(
                     db_index=True,
                     help_text='The normalized address2 of the organization')),
                ('city',
                 models.TextField(
                     db_index=True,
                     help_text='The normalized city of the organization')),
                ('state',
                 localflavor.us.models.USPostalCodeField(
                     db_index=True,
                     help_text=
                     'The two-letter USPS postal abbreviation for the organization',
                     max_length=2)),
                ('zip_code',
                 localflavor.us.models.USZipCodeField(
                     db_index=True,
                     help_text=
                     'The zip code for the organization, XXXXX or XXXXX-XXXX work.',
                     max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='AttorneyOrganizationAssociation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='CriminalComplaint',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.TextField(
                     help_text=
                     "The name of the criminal complaint, for example, '8:1326 Reentry of Deported Alien'"
                 )),
                ('disposition',
                 models.TextField(
                     blank=True,
                     help_text='The disposition of the criminal complaint.')),
            ],
        ),
        migrations.CreateModel(
            name='CriminalCount',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.TextField(
                     help_text=
                     "The name of the count, such as '21:952 and 960 - Importation of Marijuana(1)'."
                 )),
                ('disposition',
                 models.TextField(
                     blank=True,
                     help_text=
                     "The disposition of the count, such as 'Custody of BOP for 60 months, followed by 4 years supervised release. No fine. $100 penalty assessment."
                 )),
                ('status',
                 models.SmallIntegerField(
                     choices=[(1, 'Pending'), (2, 'Terminated')],
                     help_text='Whether the count is pending or terminated.')),
            ],
        ),
        migrations.CreateModel(
            name='Education',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('degree_level',
                 models.CharField(
                     blank=True,
                     choices=[
                         ('ba', "Bachelor's (e.g. B.A.)"),
                         ('ma', "Master's (e.g. M.A.)"),
                         ('jd', 'Juris Doctor (J.D.)'),
                         ('llm', 'Master of Laws (LL.M)'),
                         ('llb', 'Bachelor of Laws (e.g. LL.B)'),
                         ('jsd', 'Doctor of Law (J.S.D)'),
                         ('phd', 'Doctor of Philosophy (PhD)'),
                         ('aa', 'Associate (e.g. A.A.)'),
                         ('md', 'Medical Degree (M.D.)'),
                         ('mba', 'Master of Business Administration (M.B.A.)'),
                         ('cfa',
                          'Accounting Certification (C.P.A., C.M.A., C.F.A.)'),
                         ('cert', 'Certificate')
                     ],
                     help_text='Normalized degree level, e.g. BA, JD.',
                     max_length=4)),
                ('degree_detail',
                 models.CharField(
                     blank=True,
                     help_text=
                     'Detailed degree description, e.g. including major.',
                     max_length=100)),
                ('degree_year',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     help_text='The year the degree was awarded.',
                     null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Party',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('name',
                 models.TextField(db_index=True,
                                  help_text='The name of the party.')),
                ('extra_info',
                 models.TextField(
                     db_index=True,
                     help_text=
                     'Prior to March, 2018, this field briefly held additional info from PACER about particular parties. That was a modelling mistake and the information has been moved to the PartyType.extra_info field instead. This field will be removed in October, 2020.'
                 )),
            ],
            options={
                'verbose_name_plural':
                'Parties',
                'permissions':
                (('has_recap_api_access', 'Can work with RECAP API'), ),
            },
        ),
        migrations.CreateModel(
            name='PartyType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(
                     db_index=True,
                     help_text=
                     'The name of the type (Defendant, Plaintiff, etc.)',
                     max_length=100)),
                ('date_terminated',
                 models.DateField(
                     blank=True,
                     help_text=
                     'The date that the party was terminated from the case, if applicable.',
                     null=True)),
                ('extra_info',
                 models.TextField(blank=True,
                                  db_index=True,
                                  help_text='Additional info from PACER')),
                ('highest_offense_level_opening',
                 models.TextField(
                     blank=True,
                     help_text=
                     'In a criminal case, the highest offense level at the opening of the case.'
                 )),
                ('highest_offense_level_terminated',
                 models.TextField(
                     blank=True,
                     help_text=
                     'In a criminal case, the highest offense level at the end of the case.'
                 )),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('date_completed',
                 models.DateTimeField(
                     blank=True,
                     help_text=
                     'Whenever an editor last decided that a profile was complete in some sense.',
                     null=True)),
                ('fjc_id',
                 models.IntegerField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The ID of a judge as assigned by the Federal Judicial Center.',
                     null=True,
                     unique=True)),
                ('cl_id',
                 models.CharField(
                     db_index=True,
                     help_text=
                     'A unique identifier for judge, also indicating source of data.',
                     max_length=30,
                     unique=True)),
                ('slug',
                 models.SlugField(
                     help_text=
                     'A generated path for this item as used in CourtListener URLs',
                     max_length=158)),
                ('name_first',
                 models.CharField(help_text='The first name of this person.',
                                  max_length=50)),
                ('name_middle',
                 models.CharField(
                     blank=True,
                     help_text='The middle name or names of this person',
                     max_length=50)),
                ('name_last',
                 models.CharField(db_index=True,
                                  help_text='The last name of this person',
                                  max_length=50)),
                ('name_suffix',
                 models.CharField(
                     blank=True,
                     choices=[('jr', 'Jr.'), ('sr', 'Sr.'), ('1', 'I'),
                              ('2', 'II'),
                              ('3', 'III'), ('4', 'IV')],
                     help_text="Any suffixes that this person's name may have",
                     max_length=5)),
                ('date_dob',
                 models.DateField(blank=True,
                                  help_text='The date of birth for the person',
                                  null=True)),
                ('date_granularity_dob',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
                ('date_dod',
                 models.DateField(blank=True,
                                  help_text='The date of death for the person',
                                  null=True)),
                ('date_granularity_dod',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
                ('dob_city',
                 models.CharField(
                     blank=True,
                     help_text='The city where the person was born.',
                     max_length=50)),
                ('dob_state',
                 localflavor.us.models.USStateField(
                     blank=True,
                     help_text='The state where the person was born.',
                     max_length=2)),
                ('dob_country',
                 models.CharField(
                     blank=True,
                     default='United States',
                     help_text='The country where the person was born.',
                     max_length=50)),
                ('dod_city',
                 models.CharField(blank=True,
                                  help_text='The city where the person died.',
                                  max_length=50)),
                ('dod_state',
                 localflavor.us.models.USStateField(
                     blank=True,
                     help_text='The state where the person died.',
                     max_length=2)),
                ('dod_country',
                 models.CharField(
                     blank=True,
                     default='United States',
                     help_text='The country where the person died.',
                     max_length=50)),
                ('gender',
                 models.CharField(blank=True,
                                  choices=[('m', 'Male'), ('f', 'Female'),
                                           ('o', 'Other')],
                                  help_text="The person's gender",
                                  max_length=2)),
                ('religion',
                 models.CharField(blank=True,
                                  help_text='The religion of a person',
                                  max_length=30)),
                ('ftm_total_received',
                 models.FloatField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The amount of money received by this person and logged by Follow the Money.',
                     null=True)),
                ('ftm_eid',
                 models.CharField(
                     blank=True,
                     help_text=
                     'The ID of a judge as assigned by the Follow the Money database.',
                     max_length=30,
                     null=True)),
                ('has_photo',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Whether there is a photo corresponding to this person in the judge pics project.'
                 )),
            ],
            options={
                'verbose_name_plural': 'people',
            },
        ),
        migrations.CreateModel(
            name='PoliticalAffiliation',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('political_party',
                 models.CharField(
                     choices=[('d', 'Democratic'), ('r', 'Republican'),
                              ('i', 'Independent'), ('g', 'Green'),
                              ('l', 'Libertarian'), ('f', 'Federalist'),
                              ('w', 'Whig'), ('j', 'Jeffersonian Republican'),
                              ('u', 'National Union')],
                     help_text=
                     'The political party the person is affiliated with.',
                     max_length=5)),
                ('source',
                 models.CharField(
                     blank=True,
                     choices=[('b', 'Ballot'), ('a', 'Appointer'),
                              ('o', 'Other')],
                     help_text=
                     'The source of the political affiliation -- where it is documented that this affiliation exists.',
                     max_length=5)),
                ('date_start',
                 models.DateField(
                     blank=True,
                     help_text=
                     'The date the political affiliation was first documented',
                     null=True)),
                ('date_granularity_start',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
                ('date_end',
                 models.DateField(blank=True,
                                  help_text='The date the affiliation ended.',
                                  null=True)),
                ('date_granularity_end',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('position_type',
                 models.CharField(
                     blank=True,
                     choices=[(
                         'Judge',
                         (('act-jud', 'Acting Judge'),
                          ('act-pres-jud',
                           'Acting Presiding Judge'),
                          ('ass-jud',
                           'Associate Judge'), ('ass-c-jud',
                                                'Associate Chief Judge'),
                          ('ass-pres-jud',
                           'Associate Presiding Judge'), ('jud', 'Judge'),
                          ('jus', 'Justice'), ('c-jud',
                                               'Chief Judge'),
                          ('c-jus',
                           'Chief Justice'),
                          ('c-spec-m', 'Chief Special Master'),
                          ('pres-jud', 'Presiding Judge'),
                          ('pres-jus',
                           'Presiding Justice'), ('com', 'Commissioner'),
                          ('com-dep',
                           'Deputy Commissioner'), ('jud-pt',
                                                    'Judge Pro Tem'),
                          ('jus-pt',
                           'Justice Pro Tem'), ('ref-jud-tr',
                                                'Judge Trial Referee'),
                          ('ref-off',
                           'Official Referee'), ('ref-state-trial',
                                                 'State Trial Referee'),
                          ('ret-act-jus', 'Active Retired Justice'),
                          ('ret-ass-jud',
                           'Retired Associate Judge'), ('ret-c-jud',
                                                        'Retired Chief Judge'),
                          ('ret-jus', 'Retired Justice'), ('ret-senior-jud',
                                                           'Senior Judge'),
                          ('mag',
                           'Magistrate'), ('c-mag',
                                           'Chief Magistrate'),
                          ('pres-mag', 'Presiding Magistrate'),
                          ('mag-pt',
                           'Magistrate Pro Tem'), ('mag-rc',
                                                   'Magistrate (Recalled)'),
                          ('mag-part-time',
                           'Magistrate (Part-Time)'), ('spec-chair',
                                                       'Special Chairman'),
                          ('spec-jud',
                           'Special Judge'), ('spec-m', 'Special Master'),
                          ('spec-scjcbc',
                           'Special Superior Court Judge for Complex Business Cases'
                           ), ('chair', 'Chairman'), ('chan', 'Chancellor'),
                          ('presi-jud',
                           'President'), ('res-jud',
                                          'Reserve Judge'), ('trial-jud',
                                                             'Trial Judge'),
                          ('vice-chan',
                           'Vice Chancellor'), ('vice-cj',
                                                'Vice Chief Judge'))),
                              ('Attorney General',
                               (('att-gen', 'Attorney General'),
                                ('att-gen-ass', 'Assistant Attorney General'),
                                ('att-gen-ass-spec',
                                 'Special Assistant Attorney General'),
                                ('sen-counsel', 'Senior Counsel'),
                                ('dep-sol-gen', 'Deputy Solicitor General'))),
                              ('Appointing Authority',
                               (('pres', 'President of the United States'),
                                ('gov', 'Governor'))),
                              ('Clerkships',
                               (('clerk', 'Clerk'), ('clerk-chief-dep',
                                                     'Chief Deputy Clerk'),
                                ('staff-atty', 'Staff Attorney'))),
                              ('prof', 'Professor'), ('prac', 'Practitioner'),
                              ('pros', 'Prosecutor'),
                              ('pub-def', 'Public Defender'),
                              ('legis', 'Legislator')],
                     help_text=
                     'If this is a judicial position, this indicates the role the person had. This field may be blank if job_title is complete instead.',
                     max_length=20,
                     null=True)),
                ('job_title',
                 models.CharField(
                     blank=True,
                     help_text=
                     "If title isn't in position_type, a free-text position may be entered here.",
                     max_length=100)),
                ('sector',
                 models.SmallIntegerField(
                     blank=True,
                     choices=[(1, 'Private sector'), (2, 'Public sector')],
                     default=None,
                     help_text='Whether the job was private or public sector.',
                     null=True)),
                ('organization_name',
                 models.CharField(
                     blank=True,
                     help_text=
                     'If the organization where this position was held is not a school or court, this is the place it was held.',
                     max_length=120,
                     null=True)),
                ('location_city',
                 models.CharField(
                     blank=True,
                     help_text=
                     'If not a court or school, the city where person worked.',
                     max_length=50)),
                ('location_state',
                 localflavor.us.models.USStateField(
                     blank=True,
                     help_text=
                     'If not a court or school, the state where person worked.',
                     max_length=2)),
                ('date_nominated',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The date recorded in the Senate Executive Journal when a federal judge was nominated for their position or the date a state judge nominated by the legislature. When a nomination is by primary election, this is the date of the election. When a nomination is from a merit commission, this is the date the nomination was announced.',
                     null=True)),
                ('date_elected',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'Judges are elected in most states. This is the date of theirfirst election. This field will be null if the judge was initially selected by nomination.',
                     null=True)),
                ('date_recess_appointment',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'If a judge was appointed while congress was in recess, this is the date of that appointment.',
                     null=True)),
                ('date_referred_to_judicial_committee',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'Federal judges are usually referred to the Judicial Committee before being nominated. This is the date of that referral.',
                     null=True)),
                ('date_judicial_committee_action',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The date that the Judicial Committee took action on the referral.',
                     null=True)),
                ('judicial_committee_action',
                 models.CharField(
                     blank=True,
                     choices=[('no_rep', 'Not Reported'),
                              ('rep_w_rec',
                               'Reported with Recommendation'),
                              ('rep_wo_rec',
                               'Reported without Recommendation'),
                              ('rec_postpone', 'Recommendation Postponed'),
                              ('rec_bad', 'Recommended Unfavorably')],
                     help_text=
                     'The action that the judicial committee took in response to a nomination',
                     max_length=20)),
                ('date_hearing',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'After being nominated, a judge is usually subject to a hearing. This is the date of that hearing.',
                     null=True)),
                ('date_confirmation',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'After the hearing the senate will vote on judges. This is the date of that vote.',
                     null=True)),
                ('date_start',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text='The date the position starts active duty.',
                     null=True)),
                ('date_granularity_start',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
                ('date_termination',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The last date of their employment. The compliment to date_start',
                     null=True)),
                ('termination_reason',
                 models.CharField(blank=True,
                                  choices=[
                                      ('ded', 'Death'),
                                      ('retire_vol', 'Voluntary Retirement'),
                                      ('retire_mand', 'Mandatory Retirement'),
                                      ('resign', 'Resigned'),
                                      ('other_pos',
                                       'Appointed to Other Judgeship'),
                                      ('lost', 'Lost Election'),
                                      ('abolished', 'Court Abolished'),
                                      ('bad_judge', 'Impeached and Convicted'),
                                      ('recess_not_confirmed',
                                       'Recess Appointment Not Confirmed'),
                                      ('termed_out', 'Term Limit Reached')
                                  ],
                                  help_text='The reason for a termination',
                                  max_length=25)),
                ('date_granularity_termination',
                 models.CharField(blank=True,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')],
                                  max_length=15)),
                ('date_retirement',
                 models.DateField(
                     blank=True,
                     db_index=True,
                     help_text=
                     'The date when they become a senior judge by going into active retirement',
                     null=True)),
                ('nomination_process',
                 models.CharField(
                     blank=True,
                     choices=[('fed_senate', 'U.S. Senate'),
                              ('state_senate', 'State Senate'),
                              ('election', 'Primary Election'),
                              ('merit_comm', 'Merit Commission')],
                     help_text=
                     'The process by which a person was nominated into this position.',
                     max_length=20)),
                ('vote_type',
                 models.CharField(
                     blank=True,
                     choices=[('s', 'Senate'), ('p', 'Partisan Election'),
                              ('np', 'Non-Partisan Election')],
                     help_text=
                     'The type of vote that resulted in this position.',
                     max_length=2)),
                ('voice_vote',
                 models.BooleanField(
                     blank=True,
                     help_text=
                     'Whether the Senate voted by voice vote for this position.',
                     null=True)),
                ('votes_yes',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'If votes are an integer, this is the number of votes in favor of a position.',
                     null=True)),
                ('votes_no',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'If votes are an integer, this is the number of votes opposed to a position.',
                     null=True)),
                ('votes_yes_percent',
                 models.FloatField(
                     blank=True,
                     help_text=
                     'If votes are a percentage, this is the percentage of votes in favor of a position.',
                     null=True)),
                ('votes_no_percent',
                 models.FloatField(
                     blank=True,
                     help_text=
                     'If votes are a percentage, this is the percentage of votes opposed to a position.',
                     null=True)),
                ('how_selected',
                 models.CharField(
                     blank=True,
                     choices=[('Election', (('e_part', 'Partisan Election'),
                                            ('e_non_part',
                                             'Non-Partisan Election'))),
                              ('Appointment',
                               (('a_pres', 'Appointment (President)'),
                                ('a_gov', 'Appointment (Governor)'),
                                ('a_legis', 'Appointment (Legislature)'),
                                ('a_judge', 'Appointment (Judge)')))],
                     help_text=
                     'The method that was used for selecting this judge for this position (generally an election or appointment).',
                     max_length=20)),
                ('has_inferred_values',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Some or all of the values for this position were inferred from a data source instead of manually added. See sources field for more details.'
                 )),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Race',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('race',
                 models.CharField(choices=[
                     ('w', 'White'), ('b', 'Black or African American'),
                     ('i', 'American Indian or Alaska Native'), ('a', 'Asian'),
                     ('p', 'Native Hawaiian or Other Pacific Islander'),
                     ('h', 'Hispanic/Latino')
                 ],
                                  max_length=5,
                                  unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='RetentionEvent',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('retention_type',
                 models.CharField(
                     choices=[('reapp_gov', 'Governor Reappointment'),
                              ('reapp_leg',
                               'Legislative Reappointment'),
                              ('elec_p', 'Partisan Election'),
                              ('elec_n', 'Nonpartisan Election'),
                              ('elec_u', 'Uncontested Election')],
                     help_text=
                     'The method through which this position was retained.',
                     max_length=10)),
                ('date_retention',
                 models.DateField(db_index=True,
                                  help_text='The date of retention')),
                ('votes_yes',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'If votes are an integer, this is the number of votes in favor of a position.',
                     null=True)),
                ('votes_no',
                 models.PositiveIntegerField(
                     blank=True,
                     help_text=
                     'If votes are an integer, this is the number of votes opposed to a position.',
                     null=True)),
                ('votes_yes_percent',
                 models.FloatField(
                     blank=True,
                     help_text=
                     'If votes are a percentage, this is the percentage of votes in favor of a position.',
                     null=True)),
                ('votes_no_percent',
                 models.FloatField(
                     blank=True,
                     help_text=
                     'If votes are a percentage, this is the percentage of votes opposed to a position.',
                     null=True)),
                ('unopposed',
                 models.BooleanField(
                     blank=True,
                     help_text=
                     'Whether the position was unopposed at the time of retention.',
                     null=True)),
                ('won',
                 models.BooleanField(
                     blank=True,
                     help_text='Whether the retention event was won.',
                     null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('url',
                 models.URLField(
                     blank=True,
                     help_text='The URL where this data was gathered.',
                     max_length=2000)),
                ('date_accessed',
                 models.DateField(blank=True,
                                  help_text='The date the data was gathered.',
                                  null=True)),
                ('notes',
                 models.TextField(
                     blank=True,
                     help_text=
                     "Any additional notes about the data's provenance, in Markdown format."
                 )),
                ('person',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='sources',
                                   to='people_db.person')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_created',
                 models.DateTimeField(
                     auto_now_add=True,
                     db_index=True,
                     help_text='The moment when the item was created.')),
                ('date_modified',
                 models.DateTimeField(
                     auto_now=True,
                     db_index=True,
                     help_text=
                     'The last moment when the item was modified. A value in year 1750 indicates the value is unknown'
                 )),
                ('name',
                 models.CharField(db_index=True,
                                  help_text='The name of the school or alias',
                                  max_length=120)),
                ('ein',
                 models.IntegerField(blank=True,
                                     db_index=True,
                                     help_text='The EIN assigned by the IRS',
                                     null=True)),
                ('is_alias_of',
                 models.ForeignKey(
                     blank=True,
                     help_text='Any alternate names that a school may have',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='people_db.school')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('role',
                 models.SmallIntegerField(
                     choices=[(1, 'Attorney to be noticed'),
                              (2, 'Lead attorney'),
                              (3, 'Attorney in sealed group'),
                              (4, 'Pro hac vice'), (5, 'Self-terminated'),
                              (6, 'Terminated'), (7, 'Suspended'),
                              (8, 'Inactive'), (9, 'Disbarred'),
                              (10, 'Unknown')],
                     db_index=True,
                     help_text=
                     "The name of the attorney's role. Used primarily in district court cases.",
                     null=True)),
                ('role_raw',
                 models.TextField(
                     blank=True,
                     help_text=
                     'The raw value of the role, as a string. Items prior to 2018-06-06 may not have this value.'
                 )),
                ('date_action',
                 models.DateField(
                     help_text=
                     'The date the attorney was disbarred, suspended, terminated...',
                     null=True)),
                ('attorney',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='roles',
                                   to='people_db.attorney')),
            ],
        ),
    ]
コード例 #4
0
ファイル: models.py プロジェクト: rogeriofalcone/django-sis
class Applicant(models.Model, CustomFieldModel):
    fname = models.CharField(max_length=255, verbose_name="First Name")
    mname = models.CharField(max_length=255,
                             verbose_name="Middle Name",
                             blank=True)
    lname = models.CharField(max_length=255, verbose_name="Last Name")
    pic = models.ImageField(upload_to="applicant_pics", blank=True, null=True)
    sex = models.CharField(max_length=1,
                           choices=(('M', 'Male'), ('F', 'Female')),
                           blank=True)
    bday = models.DateField(blank=True,
                            null=True,
                            verbose_name="Birth Date",
                            validators=settings.DATE_VALIDATORS)
    unique_id = models.IntegerField(blank=True, null=True, unique=True)
    street = models.CharField(max_length=150, blank=True)
    city = models.CharField(max_length=360, blank=True)
    state = USStateField(blank=True)
    zip = models.CharField(max_length=10, blank=True)
    ssn = models.CharField(max_length=11, blank=True, verbose_name="SSN")
    parent_email = models.EmailField(blank=True, null=True)
    email = models.EmailField(blank=True, null=True)
    notes = models.TextField(blank=True)
    family_preferred_language = models.ForeignKey('sis.LanguageChoice',
                                                  blank=True,
                                                  null=True,
                                                  on_delete=models.SET_NULL,
                                                  default=get_default_language)
    siblings = models.ManyToManyField('sis.Student',
                                      blank=True,
                                      related_name="+")
    year = models.ForeignKey('sis.GradeLevel',
                             blank=True,
                             null=True,
                             on_delete=models.SET_NULL,
                             help_text="Applying for this grade level",
                             default=get_year)
    school_year = models.ForeignKey('sis.SchoolYear',
                                    blank=True,
                                    null=True,
                                    on_delete=models.SET_NULL,
                                    default=get_school_year)
    parent_guardians = models.ManyToManyField('sis.EmergencyContact',
                                              verbose_name="Student contact",
                                              blank=True,
                                              null=True)
    ethnicity = models.ForeignKey(
        EthnicityChoice,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    hs_grad_yr = models.IntegerField(blank=True, null=True, max_length=4)
    elem_grad_yr = models.IntegerField(blank=True, null=True, max_length=4)
    present_school = models.ForeignKey(
        FeederSchool,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    present_school_typed = models.CharField(
        max_length=255,
        blank=True,
        help_text=
        "This is intended for applicants to apply for the school. Administrators should use the above."
    )
    present_school_type_typed = models.CharField(max_length=255, blank=True)
    religion = models.ForeignKey(
        ReligionChoice,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    place_of_worship = models.ForeignKey(
        PlaceOfWorship,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    follow_up_date = models.DateField(blank=True,
                                      null=True,
                                      validators=settings.DATE_VALIDATORS)
    open_house_attended = models.ManyToManyField(OpenHouse,
                                                 blank=True,
                                                 null=True)
    parent_guardian_first_name = models.CharField(max_length=150, blank=True)
    parent_guardian_last_name = models.CharField(max_length=150, blank=True)
    relationship_to_student = models.CharField(max_length=500, blank=True)
    heard_about_us = models.ForeignKey(
        HeardAboutUsOption,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    from_online_inquiry = models.BooleanField(default=False, )
    first_contact = models.ForeignKey(
        FirstContactOption,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    borough = models.ForeignKey(
        BoroughOption,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    country_of_birth = models.ForeignKey(
        CountryOption,
        blank=True,
        null=True,
        default=get_default_country,
        on_delete=models.SET_NULL,
    )
    immigration_status = models.ForeignKey(
        ImmigrationOption,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    ready_for_export = models.BooleanField(default=False, )
    sis_student = models.OneToOneField('sis.Student',
                                       blank=True,
                                       null=True,
                                       related_name="appl_student",
                                       on_delete=models.SET_NULL)

    total_income = models.DecimalField(max_digits=10,
                                       decimal_places=2,
                                       blank=True,
                                       null=True)
    adjusted_available_income = models.DecimalField(max_digits=10,
                                                    decimal_places=2,
                                                    blank=True,
                                                    null=True)
    calculated_payment = models.DecimalField(max_digits=10,
                                             decimal_places=2,
                                             blank=True,
                                             null=True)

    date_added = models.DateField(auto_now_add=True,
                                  blank=True,
                                  null=True,
                                  validators=settings.DATE_VALIDATORS)
    level = models.ForeignKey(AdmissionLevel,
                              blank=True,
                              null=True,
                              on_delete=models.SET_NULL)
    checklist = models.ManyToManyField(AdmissionCheck, blank=True, null=True)
    application_decision = models.ForeignKey(
        ApplicationDecisionOption,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    application_decision_by = models.ForeignKey(
        User,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    withdrawn = models.ForeignKey(
        WithdrawnChoices,
        blank=True,
        null=True,
        on_delete=models.SET_NULL,
    )
    withdrawn_note = models.CharField(max_length=500, blank=True)
    first_to_college = models.BooleanField(default=False, blank=True)
    individual_education_plan = models.BooleanField(default=False, blank=True)
    lives_with = models.CharField(
        blank=True,
        max_length=50,
        choices=(
            ('Both Parents', 'Both Parents'),
            ('Mother', 'Mother'),
            ('Father', 'Father'),
            ('Guardian(s)', 'Guardian(s)'),
        ),
    )

    class Meta:
        ordering = (
            'lname',
            'fname',
        )

    def __unicode__(self):
        return "%s %s %s" % (self.fname, self.mname, self.lname)

    @property
    def parent_guardian(self):
        """ Compatibility to act like sis.student parent_guardian
        """
        return u"{} {}".format(self.parent_guardian_first_name,
                               self.parent_guardian_last_name)

    def set_cache(self, contact):
        self.parent_guardian_first_name = contact.fname
        self.parent_guardian_last_name = contact.lname
        self.street = contact.street
        self.state = contact.state
        self.zip = contact.zip
        self.city = contact.city
        self.parent_email = contact.email
        self.save()

        for contact in self.parent_guardians.exclude(id=contact.id):
            # There should only be one primary contact!
            if contact.primary_contact:
                contact.primary_contact = False
                contact.save()

    def __set_level(self):
        prev = None
        for level in AdmissionLevel.objects.all():
            checks = level.admissioncheck_set.filter(required=True)
            i = 0
            for check in checks:
                if check in self.checklist.all():
                    i += 1
            if not i >= checks.count():
                break
            prev = level
        self.level = prev

    def save(self, *args, **kwargs):
        if self.id:
            self.__set_level()
        # create contact log entry on application decision
        if self.application_decision and self.id:
            old = Applicant.objects.get(id=self.id)
            if not old.application_decision:
                contact_log = ContactLog(user=self.application_decision_by,
                                         applicant=self,
                                         note="Application Decision: %s" %
                                         (self.application_decision, ))
                contact_log.save()
        super(Applicant, self).save(*args, **kwargs)
コード例 #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies: List[Tuple[str, str]] = []

    operations = [
        migrations.CreateModel(
            name='Car',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'license_plate',
                    models.CharField(
                        max_length=31,
                        validators=[
                            django.core.validators.RegexValidator(
                                '^[a-zA-Z0-9 ]*$',
                                'Only alphanumeric characters and spaces allowed',
                            )
                        ],
                    ),
                ),
                ('state', localflavor.us.models.USStateField(max_length=2)),
                ('make', models.CharField(max_length=63)),
                ('model', models.CharField(max_length=63)),
                (
                    'year',
                    models.PositiveIntegerField(validators=[
                        django.core.validators.MaxValueValidator(2020),
                        django.core.validators.MinValueValidator(1903),
                    ]),
                ),
                ('color', models.CharField(max_length=63)),
            ],
        ),
        migrations.CreateModel(
            name='ClimbingLeaderApplication',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                (
                    'previous_rating',
                    models.CharField(blank=True,
                                     help_text='Previous rating (if any)',
                                     max_length=255),
                ),
                (
                    'year',
                    models.PositiveIntegerField(
                        default=ws.utils.dates.ws_year,
                        help_text='Year this application pertains to.',
                        validators=[
                            django.core.validators.MinValueValidator(2014)
                        ],
                    ),
                ),
                (
                    'desired_rating',
                    models.CharField(
                        choices=[
                            ('Bouldering', 'Bouldering'),
                            ('Single-pitch', 'Single-pitch'),
                            ('Multi-pitch', 'Multi-pitch'),
                            ('Bouldering + Single-pitch',
                             'Bouldering + Single-pitch'),
                            ('Bouldering + Multi-pitch',
                             'Bouldering + Multi-pitch'),
                        ],
                        max_length=32,
                    ),
                ),
                ('years_climbing', models.IntegerField()),
                ('years_climbing_outside', models.IntegerField()),
                (
                    'outdoor_bouldering_grade',
                    models.CharField(
                        help_text=
                        'At what grade are you comfortable bouldering outside?',
                        max_length=255,
                    ),
                ),
                (
                    'outdoor_sport_leading_grade',
                    models.CharField(
                        help_text=
                        'At what grade are you comfortable leading outside on sport routes?',
                        max_length=255,
                    ),
                ),
                (
                    'outdoor_trad_leading_grade',
                    models.CharField(
                        help_text=
                        'At what grade are you comfortable leading outside on trad routes?',
                        max_length=255,
                    ),
                ),
                (
                    'familiarity_spotting',
                    models.CharField(
                        choices=[
                            ('none', 'not at all'),
                            ('some', 'some exposure'),
                            ('comfortable', 'comfortable'),
                            ('very comfortable', 'very comfortable'),
                        ],
                        max_length=16,
                        verbose_name=
                        'Familarity with spotting boulder problems',
                    ),
                ),
                (
                    'familiarity_bolt_anchors',
                    models.CharField(
                        choices=[
                            ('none', 'not at all'),
                            ('some', 'some exposure'),
                            ('comfortable', 'comfortable'),
                            ('very comfortable', 'very comfortable'),
                        ],
                        max_length=16,
                        verbose_name="Familiarity with 2-bolt 'sport' anchors",
                    ),
                ),
                (
                    'familiarity_gear_anchors',
                    models.CharField(
                        choices=[
                            ('none', 'not at all'),
                            ('some', 'some exposure'),
                            ('comfortable', 'comfortable'),
                            ('very comfortable', 'very comfortable'),
                        ],
                        max_length=16,
                        verbose_name="Familiarity with trad 'gear' anchors",
                    ),
                ),
                (
                    'familiarity_sr',
                    models.CharField(
                        choices=[
                            ('none', 'not at all'),
                            ('some', 'some exposure'),
                            ('comfortable', 'comfortable'),
                            ('very comfortable', 'very comfortable'),
                        ],
                        max_length=16,
                        verbose_name='Familiarity with multi-pitch self-rescue',
                    ),
                ),
                (
                    'spotting_description',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Describe how you would spot a climber on a meandering tall bouldering problem.',
                    ),
                ),
                (
                    'tr_anchor_description',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Describe how you would build a top-rope anchor at a sport crag.',
                        verbose_name='Top rope anchor description',
                    ),
                ),
                (
                    'rappel_description',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Describe how you would set up a safe rappel.',
                    ),
                ),
                (
                    'gear_anchor_description',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Describe what you look for when building a typical gear anchor.',
                    ),
                ),
                ('formal_training', models.TextField(blank=True)),
                ('teaching_experience', models.TextField(blank=True)),
                (
                    'notable_climbs',
                    models.TextField(
                        blank=True,
                        help_text=
                        'What are some particularly memorable climbs you have done?',
                    ),
                ),
                (
                    'favorite_route',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Do you have a favorite route? If so, what is it and why?',
                    ),
                ),
                (
                    'extra_info',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Is there anything else you would like us to know?',
                    ),
                ),
            ],
            options={
                'ordering': ['time_created'],
                'abstract': False
            },
        ),
        migrations.CreateModel(
            name='Discount',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'active',
                    models.BooleanField(
                        default=True,
                        help_text='Discount is currently open & active'),
                ),
                ('name', models.CharField(max_length=255)),
                ('summary', models.CharField(max_length=255)),
                ('terms', models.TextField(max_length=4095)),
                ('url', models.URLField(blank=True, null=True)),
                (
                    'ga_key',
                    models.CharField(
                        help_text=
                        'key for Google spreadsheet with membership information (shared as read-only with the company)',
                        max_length=63,
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                (
                    'student_required',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Discount provider requires recipients to be students',
                    ),
                ),
                (
                    'report_school',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Report MIT affiliation if participant is a student',
                    ),
                ),
                (
                    'report_student',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Report MIT affiliation and student status to discount provider',
                    ),
                ),
                (
                    'report_leader',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Report MITOC leader status to discount provider',
                    ),
                ),
                (
                    'report_access',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Report if participant should have leader, student, or admin level access',
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name='EmergencyContact',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('name', models.CharField(max_length=255)),
                (
                    'cell_phone',
                    phonenumber_field.modelfields.PhoneNumberField(
                        max_length=128),
                ),
                ('relationship', models.CharField(max_length=63)),
                ('email', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='EmergencyInfo',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('allergies', models.CharField(max_length=255)),
                ('medications', models.CharField(max_length=255)),
                (
                    'medical_history',
                    models.TextField(
                        help_text=
                        'Anything your trip leader would want to know about.',
                        max_length=2000,
                    ),
                ),
                (
                    'emergency_contact',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.EmergencyContact',
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name='Feedback',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('showed_up', models.BooleanField(default=True)),
                ('comments', models.TextField(max_length=2000)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={'ordering': ['participant', '-time_created']},
        ),
        migrations.CreateModel(
            name='HikingLeaderApplication',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                (
                    'previous_rating',
                    models.CharField(blank=True,
                                     help_text='Previous rating (if any)',
                                     max_length=255),
                ),
                (
                    'year',
                    models.PositiveIntegerField(
                        default=ws.utils.dates.ws_year,
                        help_text='Year this application pertains to.',
                        validators=[
                            django.core.validators.MinValueValidator(2014)
                        ],
                    ),
                ),
                (
                    'desired_rating',
                    models.CharField(
                        choices=[('Leader', 'Leader'),
                                 ('Co-Leader', 'Co-Leader')],
                        help_text=
                        'Co-Leader: Can co-lead a 3-season hiking trip with a Leader. Leader: Can run 3-season hiking trips.',
                        max_length=10,
                    ),
                ),
                (
                    'mitoc_experience',
                    models.TextField(
                        help_text=
                        'How long have you been a MITOC member? Please indicate what official MITOC hikes and Circuses you have been on. Include approximate dates and locations, number of participants, trail conditions, type of trip, etc. Give details of whether you participated, led, or co-led these trips. [Optional]: If you like, briefly summarize your experience on unofficial trips or experience outside of New England.',
                        max_length=5000,
                        verbose_name='Hiking Experience with MITOC',
                    ),
                ),
                (
                    'formal_training',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Please give details of any medical training and qualifications, with dates. Also include any other formal outdoor education or qualifications.',
                        max_length=5000,
                    ),
                ),
                (
                    'leadership_experience',
                    models.TextField(
                        blank=True,
                        help_text=
                        "If you've been a leader elsewhere, please describe that here. This could include leadership in other collegiate outing clubs, student sports clubs, NOLS, Outward Bound, or AMC; working as a guide, summer camp counselor, or Scout leader; or organizing hikes with friends.",
                        max_length=5000,
                        verbose_name='Group outdoor/leadership experience',
                    ),
                ),
            ],
            options={
                'ordering': ['time_created'],
                'abstract': False
            },
        ),
        migrations.CreateModel(
            name='LeaderRating',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                (
                    'activity',
                    models.CharField(
                        choices=[
                            ('biking', 'Biking'),
                            ('boating', 'Boating'),
                            ('cabin', 'Cabin'),
                            ('climbing', 'Climbing'),
                            ('hiking', 'Hiking'),
                            ('winter_school', 'Winter School'),
                            ('circus', 'Circus'),
                            ('official_event', 'Official Event'),
                            ('course', 'Course'),
                        ],
                        max_length=31,
                    ),
                ),
                ('rating', models.CharField(max_length=31)),
                ('notes', models.TextField(blank=True, max_length=500)),
                ('active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['participant'],
                'abstract': False
            },
        ),
        migrations.CreateModel(
            name='LeaderRecommendation',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                (
                    'activity',
                    models.CharField(
                        choices=[
                            ('biking', 'Biking'),
                            ('boating', 'Boating'),
                            ('cabin', 'Cabin'),
                            ('climbing', 'Climbing'),
                            ('hiking', 'Hiking'),
                            ('winter_school', 'Winter School'),
                            ('circus', 'Circus'),
                            ('official_event', 'Official Event'),
                            ('course', 'Course'),
                        ],
                        max_length=31,
                    ),
                ),
                ('rating', models.CharField(max_length=31)),
                ('notes', models.TextField(blank=True, max_length=500)),
            ],
            options={
                'ordering': ['participant'],
                'abstract': False
            },
        ),
        migrations.CreateModel(
            name='LeaderSignUp',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('notes', models.TextField(blank=True, max_length=1000)),
            ],
            options={'ordering': ['time_created']},
        ),
        migrations.CreateModel(
            name='LectureAttendance',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'year',
                    models.PositiveIntegerField(
                        default=ws.utils.dates.ws_year,
                        help_text=
                        'Winter School year when lectures were attended.',
                        validators=[
                            django.core.validators.MinValueValidator(2016)
                        ],
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='LotteryInfo',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'car_status',
                    models.CharField(
                        choices=[
                            ('none', 'Not driving'),
                            ('own', 'Can drive own car'),
                            ('rent', 'Willing to rent'),
                        ],
                        default='none',
                        max_length=7,
                    ),
                ),
                (
                    'number_of_passengers',
                    models.PositiveIntegerField(
                        blank=True,
                        null=True,
                        validators=[
                            django.core.validators.MaxValueValidator(
                                13, message='Do you drive a bus?')
                        ],
                    ),
                ),
                ('last_updated', models.DateTimeField(auto_now=True)),
            ],
            options={'ordering': ['car_status', 'number_of_passengers']},
        ),
        migrations.CreateModel(
            name='MentorActivity',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('name', models.CharField(max_length=31, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Participant',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('user_id', models.IntegerField()),
                ('name', models.CharField(max_length=255)),
                (
                    'cell_phone',
                    phonenumber_field.modelfields.PhoneNumberField(
                        blank=True, max_length=128),
                ),
                ('last_updated', models.DateTimeField(auto_now=True)),
                (
                    'email',
                    models.EmailField(
                        help_text=
                        "This will be shared with leaders & other participants. <a href='/accounts/email/'>Manage email addresses</a>.",
                        max_length=254,
                        unique=True,
                    ),
                ),
                (
                    'affiliation',
                    models.CharField(
                        choices=[
                            (
                                'Undergraduate student',
                                [('MU', 'MIT undergrad'),
                                 ('NU', 'Non-MIT undergrad')],
                            ),
                            (
                                'Graduate student',
                                [
                                    ('MG', 'MIT grad student'),
                                    ('NG', 'Non-MIT grad student'),
                                ],
                            ),
                            ('MA', 'MIT affiliate'),
                            ('NA', 'Non-affiliate'),
                        ],
                        max_length=2,
                    ),
                ),
                (
                    'car',
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.Car',
                    ),
                ),
                ('discounts',
                 models.ManyToManyField(blank=True, to='ws.Discount')),
                (
                    'emergency_info',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.EmergencyInfo',
                    ),
                ),
            ],
            options={'ordering': ['name', 'email']},
        ),
        migrations.CreateModel(
            name='SignUp',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('notes', models.TextField(blank=True, max_length=1000)),
                ('order', models.IntegerField(blank=True, null=True)),
                ('manual_order', models.IntegerField(blank=True, null=True)),
                ('on_trip', models.BooleanField(default=False)),
                (
                    'participant',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.Participant'),
                ),
            ],
            options={'ordering': ['manual_order', 'last_updated']},
        ),
        migrations.CreateModel(
            name='Trip',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'activity',
                    models.CharField(
                        choices=[
                            ('biking', 'Biking'),
                            ('boating', 'Boating'),
                            ('cabin', 'Cabin'),
                            ('climbing', 'Climbing'),
                            ('hiking', 'Hiking'),
                            ('winter_school', 'Winter School'),
                            ('circus', 'Circus'),
                            ('official_event', 'Official Event'),
                            ('course', 'Course'),
                        ],
                        default='winter_school',
                        max_length=31,
                    ),
                ),
                (
                    'allow_leader_signups',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Allow leaders to sign themselves up as trip leaders. (Leaders can always sign up as participants). Recommended for Circuses!',
                    ),
                ),
                ('name', models.CharField(max_length=127)),
                ('description', models.TextField()),
                (
                    'maximum_participants',
                    models.PositiveIntegerField(
                        default=8, verbose_name='Max participants'),
                ),
                ('difficulty_rating', models.CharField(max_length=63)),
                (
                    'level',
                    models.CharField(
                        blank=True,
                        help_text=
                        "This trip's A, B, or C designation (plus I/S rating if applicable).",
                        max_length=255,
                        null=True,
                    ),
                ),
                (
                    'prereqs',
                    models.CharField(blank=True,
                                     max_length=255,
                                     verbose_name='Prerequisites'),
                ),
                ('chair_approved', models.BooleanField(default=False)),
                (
                    'notes',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Participants must add notes to their signups if you complete this field. This is a great place to ask important questions.',
                        max_length=2000,
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_edited', models.DateTimeField(auto_now=True)),
                ('trip_date',
                 models.DateField(default=ws.utils.dates.nearest_sat)),
                (
                    'signups_open_at',
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                (
                    'signups_close_at',
                    models.DateTimeField(blank=True,
                                         default=ws.utils.dates.wed_morning,
                                         null=True),
                ),
                (
                    'let_participants_drop',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'Allow participants to remove themselves from the trip any time before its start date.',
                    ),
                ),
                (
                    'honor_participant_pairing',
                    models.BooleanField(
                        default=True,
                        help_text=
                        'Try to place paired participants together on the trip.',
                    ),
                ),
                (
                    'algorithm',
                    models.CharField(
                        choices=[
                            ('lottery', 'lottery'),
                            ('fcfs', 'first-come, first-serve'),
                        ],
                        default='lottery',
                        max_length=31,
                    ),
                ),
                (
                    'lottery_task_id',
                    models.CharField(blank=True,
                                     max_length=36,
                                     null=True,
                                     unique=True),
                ),
                ('lottery_log', models.TextField(blank=True, null=True)),
                (
                    'creator',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='created_trips',
                        to='ws.Participant',
                    ),
                ),
            ],
            options={'ordering': ['-trip_date', '-time_created']},
        ),
        migrations.CreateModel(
            name='TripInfo',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('start_location', models.CharField(max_length=127)),
                ('start_time', models.CharField(max_length=63)),
                (
                    'turnaround_time',
                    models.CharField(
                        blank=True,
                        help_text=
                        "The time at which you'll turn back and head for your car/starting location",
                        max_length=63,
                    ),
                ),
                (
                    'return_time',
                    models.CharField(
                        help_text=
                        'When you expect to return to your car/starting location and be able to call the WIMP',
                        max_length=63,
                    ),
                ),
                (
                    'worry_time',
                    models.CharField(
                        help_text=
                        'Suggested: return time +3 hours. If the WIMP has not heard from you after this time and is unable to make contact with any leaders or participants, the authorities will be called.',
                        max_length=63,
                    ),
                ),
                (
                    'itinerary',
                    models.TextField(
                        help_text=
                        'A detailed account of your trip plan. Where will you be going? What route will you be taking? Include trails, peaks, intermediate destinations, back-up plans- anything that would help rescuers find you.'
                    ),
                ),
                (
                    'drivers',
                    models.ManyToManyField(
                        blank=True,
                        help_text=
                        "If a trip participant is driving, but is not on this list, they must first submit <a href='/profile/edit/#car'>information about their car</a>. They should then be added here.",
                        to='ws.Participant',
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name='WaitList',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'trip',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.Trip'),
                ),
            ],
        ),
        migrations.CreateModel(
            name='WaitListSignup',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('manual_order', models.IntegerField(blank=True, null=True)),
                (
                    'signup',
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.SignUp'),
                ),
                (
                    'waitlist',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.WaitList'),
                ),
            ],
            options={'ordering': ['-manual_order', 'time_created']},
        ),
        migrations.CreateModel(
            name='WinterSchoolLeaderApplication',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                (
                    'previous_rating',
                    models.CharField(blank=True,
                                     help_text='Previous rating (if any)',
                                     max_length=255),
                ),
                (
                    'year',
                    models.PositiveIntegerField(
                        default=ws.utils.dates.ws_year,
                        help_text='Year this application pertains to.',
                        validators=[
                            django.core.validators.MinValueValidator(2014)
                        ],
                    ),
                ),
                ('desired_rating', models.CharField(max_length=255)),
                (
                    'taking_wfa',
                    models.CharField(
                        choices=[
                            ('Yes', 'Yes'),
                            ('No', 'No'),
                            ('Maybe', "Maybe/don't know"),
                        ],
                        help_text=
                        'Save $100 on the course fee by leading two or more trips!',
                        max_length=10,
                        verbose_name=
                        'Do you plan on taking the subsidized WFA at MIT?',
                    ),
                ),
                (
                    'training',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Details of any medical, technical, or leadership training and qualifications relevant to the winter environment. State the approximate dates of these activities. Leave blank if not applicable.',
                        max_length=5000,
                        verbose_name='Formal training and qualifications',
                    ),
                ),
                (
                    'winter_experience',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Details of previous winter outdoors experience. Include the type of trip (x-country skiiing, above treeline, snowshoeing, ice climbing, etc), approximate dates and locations, numbers of participants, notable trail and weather conditions. Please also give details of whether you participated, led, or co-led these trips.',
                        max_length=5000,
                    ),
                ),
                (
                    'other_experience',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Details about any relevant non-winter experience',
                        max_length=5000,
                        verbose_name='Other outdoors/leadership experience',
                    ),
                ),
                (
                    'notes_or_comments',
                    models.TextField(
                        blank=True,
                        help_text=
                        'Any relevant details, such as any limitations on availability on Tue/Thurs nights or weekends during IAP.',
                        max_length=5000,
                    ),
                ),
                (
                    'mentee_activities',
                    models.ManyToManyField(
                        blank=True,
                        help_text='Please select at least one.',
                        related_name='mentee_activities',
                        to='ws.MentorActivity',
                        verbose_name=
                        'For which activities would you like a mentor?',
                    ),
                ),
                (
                    'mentor_activities',
                    models.ManyToManyField(
                        blank=True,
                        help_text='Please select at least one.',
                        related_name='activities_mentored',
                        to='ws.MentorActivity',
                        verbose_name=
                        'Which activities would you like to mentor?',
                    ),
                ),
                (
                    'participant',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.Participant'),
                ),
            ],
            options={
                'ordering': ['time_created'],
                'abstract': False
            },
        ),
        migrations.CreateModel(
            name='WinterSchoolSettings',
            fields=[
                (
                    'id',
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                (
                    'allow_setting_attendance',
                    models.BooleanField(
                        default=False,
                        verbose_name='Let participants set lecture attendance',
                    ),
                ),
                (
                    'last_updated_by',
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to='ws.Participant',
                    ),
                ),
            ],
            options={'abstract': False},
        ),
        migrations.AddField(
            model_name='waitlist',
            name='unordered_signups',
            field=models.ManyToManyField(through='ws.WaitListSignup',
                                         to='ws.SignUp'),
        ),
        migrations.AddField(
            model_name='trip',
            name='info',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.TripInfo',
            ),
        ),
        migrations.AddField(
            model_name='trip',
            name='leaders',
            field=models.ManyToManyField(blank=True,
                                         related_name='trips_led',
                                         to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='trip',
            name='signed_up_participants',
            field=models.ManyToManyField(through='ws.SignUp',
                                         to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='signup',
            name='trip',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='ws.Trip'),
        ),
        migrations.AddField(
            model_name='lotteryinfo',
            name='paired_with',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='paired_by',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='lotteryinfo',
            name='participant',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='lectureattendance',
            name='creator',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='lecture_attendances_marked',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='lectureattendance',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='leadersignup',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='leadersignup',
            name='trip',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to='ws.Trip'),
        ),
        migrations.AddField(
            model_name='leaderrecommendation',
            name='creator',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='recommendations_created',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='leaderrecommendation',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='leaderrating',
            name='creator',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='ratings_created',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='leaderrating',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='hikingleaderapplication',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='feedback',
            name='leader',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='authored_feedback',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='feedback',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
        migrations.AddField(
            model_name='feedback',
            name='trip',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Trip',
            ),
        ),
        migrations.AddField(
            model_name='discount',
            name='administrators',
            field=models.ManyToManyField(
                blank=True,
                help_text='Persons selected to administer this discount',
                related_name='discounts_administered',
                to='ws.Participant',
            ),
        ),
        migrations.AddField(
            model_name='climbingleaderapplication',
            name='participant',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='ws.Participant'),
        ),
    ]
コード例 #6
0
class Migration(migrations.Migration):

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ABARating',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('date_rated', models.DateField(null=True, blank=True)),
                ('date_granularity_rated',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('rating',
                 models.CharField(max_length=5,
                                  choices=[
                                      ('ewq', 'Exceptionally Well Qualified'),
                                      ('wq', 'Well Qualified'),
                                      ('q', 'Qualified'),
                                      ('nq', 'Not Qualified'),
                                      ('nqa', 'Not Qualified By Reason of Age')
                                  ])),
            ],
        ),
        migrations.CreateModel(
            name='Education',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('degree_level',
                 models.CharField(
                     blank=True,
                     max_length=2,
                     choices=[
                         ('ba', "Bachelor's (e.g. B.A.)"),
                         ('ma', "Master's (e.g. M.A.)"),
                         ('jd', 'Juris Doctor (J.D.)'),
                         ('llm', 'Master of Laws (LL.M)'),
                         ('llb', 'Bachelor of Laws (e.g. LL.B)'),
                         ('jsd', 'Doctor of Law (J.S.D)'),
                         ('phd', 'Doctor of Philosophy (PhD)'),
                         ('aa', 'Associate (e.g. A.A.)'),
                         ('md', 'Medical Degree (M.D.)'),
                         ('mba', 'Master of Business Administration (M.B.A.)')
                     ])),
                ('degree', models.CharField(max_length=100, blank=True)),
                ('degree_year',
                 models.PositiveSmallIntegerField(
                     help_text='The year the degree was awarded.',
                     null=True,
                     blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('fjc_id',
                 models.IntegerField(
                     help_text=
                     'The ID of a judge as assigned by the Federal Judicial Center.',
                     unique=True,
                     null=True,
                     db_index=True,
                     blank=True)),
                ('slug', models.SlugField(max_length=158)),
                ('name_first', models.CharField(max_length=50)),
                ('name_middle', models.CharField(max_length=50, blank=True)),
                ('name_last', models.CharField(max_length=50, db_index=True)),
                ('name_suffix',
                 models.CharField(blank=True,
                                  max_length=5,
                                  choices=[('jr', 'Jr.'), ('sr', 'Sr.'),
                                           ('1', 'I'), ('2', 'II'),
                                           ('3', 'III'), ('4', 'IV')])),
                ('date_dob', models.DateField(null=True, blank=True)),
                ('date_granularity_dob',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('date_dod', models.DateField(null=True, blank=True)),
                ('date_granularity_dod',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('dob_city', models.CharField(max_length=50, blank=True)),
                ('dob_state',
                 localflavor.us.models.USStateField(
                     blank=True,
                     max_length=2,
                     choices=[
                         ('AL', 'Alabama'), ('AK', 'Alaska'),
                         ('AS', 'American Samoa'), ('AZ', 'Arizona'),
                         ('AR', 'Arkansas'), ('AA', 'Armed Forces Americas'),
                         ('AE', 'Armed Forces Europe'),
                         ('AP', 'Armed Forces Pacific'), ('CA', 'California'),
                         ('CO', 'Colorado'), ('CT', 'Connecticut'),
                         ('DE', 'Delaware'), ('DC', 'District of Columbia'),
                         ('FL', 'Florida'), ('GA', 'Georgia'), ('GU', 'Guam'),
                         ('HI', 'Hawaii'), ('ID', 'Idaho'), ('IL', 'Illinois'),
                         ('IN', 'Indiana'), ('IA', 'Iowa'), ('KS', 'Kansas'),
                         ('KY', 'Kentucky'), ('LA', 'Louisiana'),
                         ('ME', 'Maine'), ('MD', 'Maryland'),
                         ('MA', 'Massachusetts'), ('MI', 'Michigan'),
                         ('MN', 'Minnesota'), ('MS', 'Mississippi'),
                         ('MO', 'Missouri'), ('MT', 'Montana'),
                         ('NE', 'Nebraska'), ('NV', 'Nevada'),
                         ('NH', 'New Hampshire'), ('NJ', 'New Jersey'),
                         ('NM', 'New Mexico'), ('NY', 'New York'),
                         ('NC', 'North Carolina'), ('ND', 'North Dakota'),
                         ('MP', 'Northern Mariana Islands'), ('OH', 'Ohio'),
                         ('OK', 'Oklahoma'), ('OR', 'Oregon'),
                         ('PA', 'Pennsylvania'), ('PR', 'Puerto Rico'),
                         ('RI', 'Rhode Island'), ('SC', 'South Carolina'),
                         ('SD', 'South Dakota'), ('TN', 'Tennessee'),
                         ('TX', 'Texas'), ('UT', 'Utah'), ('VT', 'Vermont'),
                         ('VI', 'Virgin Islands'), ('VA', 'Virginia'),
                         ('WA', 'Washington'), ('WV', 'West Virginia'),
                         ('WI', 'Wisconsin'), ('WY', 'Wyoming')
                     ])),
                ('dod_city', models.CharField(max_length=50, blank=True)),
                ('dod_state',
                 localflavor.us.models.USStateField(
                     blank=True,
                     max_length=2,
                     choices=[
                         ('AL', 'Alabama'), ('AK', 'Alaska'),
                         ('AS', 'American Samoa'), ('AZ', 'Arizona'),
                         ('AR', 'Arkansas'), ('AA', 'Armed Forces Americas'),
                         ('AE', 'Armed Forces Europe'),
                         ('AP', 'Armed Forces Pacific'), ('CA', 'California'),
                         ('CO', 'Colorado'), ('CT', 'Connecticut'),
                         ('DE', 'Delaware'), ('DC', 'District of Columbia'),
                         ('FL', 'Florida'), ('GA', 'Georgia'), ('GU', 'Guam'),
                         ('HI', 'Hawaii'), ('ID', 'Idaho'), ('IL', 'Illinois'),
                         ('IN', 'Indiana'), ('IA', 'Iowa'), ('KS', 'Kansas'),
                         ('KY', 'Kentucky'), ('LA', 'Louisiana'),
                         ('ME', 'Maine'), ('MD', 'Maryland'),
                         ('MA', 'Massachusetts'), ('MI', 'Michigan'),
                         ('MN', 'Minnesota'), ('MS', 'Mississippi'),
                         ('MO', 'Missouri'), ('MT', 'Montana'),
                         ('NE', 'Nebraska'), ('NV', 'Nevada'),
                         ('NH', 'New Hampshire'), ('NJ', 'New Jersey'),
                         ('NM', 'New Mexico'), ('NY', 'New York'),
                         ('NC', 'North Carolina'), ('ND', 'North Dakota'),
                         ('MP', 'Northern Mariana Islands'), ('OH', 'Ohio'),
                         ('OK', 'Oklahoma'), ('OR', 'Oregon'),
                         ('PA', 'Pennsylvania'), ('PR', 'Puerto Rico'),
                         ('RI', 'Rhode Island'), ('SC', 'South Carolina'),
                         ('SD', 'South Dakota'), ('TN', 'Tennessee'),
                         ('TX', 'Texas'), ('UT', 'Utah'), ('VT', 'Vermont'),
                         ('VI', 'Virgin Islands'), ('VA', 'Virginia'),
                         ('WA', 'Washington'), ('WV', 'West Virginia'),
                         ('WI', 'Wisconsin'), ('WY', 'Wyoming')
                     ])),
                ('gender',
                 models.CharField(max_length=2,
                                  choices=[('m', 'Male'), ('f', 'Female'),
                                           ('o', 'Other')])),
            ],
            options={
                'verbose_name_plural': 'people',
            },
        ),
        migrations.CreateModel(
            name='PoliticalAffiliation',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('political_party',
                 models.CharField(max_length=5,
                                  choices=[('d', 'Democrat'),
                                           ('r', 'Republican'),
                                           ('i', 'Independent'),
                                           ('g', 'Green'),
                                           ('l', 'Libertarian'),
                                           ('f', 'Federalist'), ('w', 'Whig'),
                                           ('j', 'Jeffersonian Republican')])),
                ('source',
                 models.CharField(blank=True,
                                  max_length=5,
                                  choices=[('b', 'Ballot'), ('a', 'Appointer'),
                                           ('o', 'Other')])),
                ('date_start', models.DateField(null=True, blank=True)),
                ('date_granularity_start',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('date_end', models.DateField(null=True, blank=True)),
                ('date_granularity_end',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
            ],
        ),
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('position_type',
                 models.CharField(
                     blank=True,
                     max_length=20,
                     null=True,
                     choices=[(
                         'Judge',
                         (('act-jud', 'Acting Judge'),
                          ('act-pres-jud',
                           'Acting Presiding Judge'),
                          ('ass-jud',
                           'Associate Judge'), ('ass-c-jud',
                                                'Associate Chief Judge'),
                          ('ass-pres-jud',
                           'Associate Presiding Judge'), ('jud', 'Judge'),
                          ('jus', 'Justice'), ('c-jud',
                                               'Chief Judge'),
                          ('c-jus',
                           'Chief Justice'),
                          ('pres-jud', 'Presiding Judge'),
                          ('pres-jus', 'Presiding Justice'),
                          ('pres-mag',
                           'Presiding Magistrate'), ('com', 'Commissioner'),
                          ('com-dep',
                           'Deputy Commissioner'), ('jud-pt',
                                                    'Judge Pro Tem'),
                          ('jus-pt',
                           'Justice Pro Tem'), ('mag-pt',
                                                'Magistrate Pro Tem'),
                          ('ref-jud-tr',
                           'Judge Trial Referee'),
                          ('ref-off',
                           'Official Referee'), ('ref-state-trial',
                                                 'State Trial Referee'),
                          ('ret-act-jus', 'Active Retired Justice'),
                          ('ret-ass-jud',
                           'Retired Associate Judge'), ('ret-c-jud',
                                                        'Retired Chief Judge'),
                          ('ret-jus', 'Retired Justice'), ('ret-senior-jud',
                                                           'Senior Judge'),
                          ('spec-chair',
                           'Special Chairman'), ('spec-jud', 'Special Judge'),
                          ('spec-m',
                           'Special Master'),
                          ('spec-scjcbc',
                           'Special Superior Court Judge for Complex Business Cases'
                           ), ('chair',
                               'Chairman'), ('chan',
                                             'Chancellor'), ('mag',
                                                             'Magistrate'),
                          ('presi-jud',
                           'President'), ('res-jud',
                                          'Reserve Judge'), ('trial-jud',
                                                             'Trial Judge'),
                          ('vice-chan',
                           'Vice Chancellor'), ('vice-cj',
                                                'Vice Chief Judge'))),
                              ('Attorney General',
                               (('att-gen', 'Attorney General'),
                                ('att-gen-ass', 'Assistant Attorney General'),
                                ('att-gen-ass-spec',
                                 'Special Assistant Attorney General'),
                                ('sen-counsel', 'Senior Counsel'),
                                ('dep-sol-gen', 'Deputy Solicitor General'))),
                              ('Appointing Authority', (('pres', 'President'),
                                                        ('gov', 'Governor'))),
                              ('Clerkships', (('clerk', 'Clerk'),
                                              ('staff-atty',
                                               'Staff Attorney'))),
                              ('prof', 'Professor'), ('prac', 'Practitioner'),
                              ('pros', 'Prosecutor'),
                              ('pub_def', 'Public Defender'),
                              ('legis', 'Legislator')])),
                ('job_title',
                 models.CharField(
                     help_text="If title isn't in list, type here.",
                     max_length=100,
                     blank=True)),
                ('organization_name',
                 models.CharField(
                     help_text='If org isnt court or school, type here.',
                     max_length=120,
                     null=True,
                     blank=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The time when this item was created',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('date_nominated',
                 models.DateField(
                     help_text=
                     'The date recorded in the Senate Executive Journal when a federal judge was nominated for their position or the date a state judge nominated by the legislature. When a nomination is by primary election, this is the date of the election. When a nomination is from a merit commission, this is the date the nomination was announced.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_elected',
                 models.DateField(
                     help_text=
                     'Judges are elected in most states. This is the date of theirfirst election. This field will be null if the judge was initially selected by nomination.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_recess_appointment',
                 models.DateField(
                     help_text=
                     'If a judge was appointed while congress was in recess, this is the date of that appointment.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_referred_to_judicial_committee',
                 models.DateField(
                     help_text=
                     'Federal judges are usually referred to the Judicial Committee before being nominated. This is the date of that referral.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_judicial_committee_action',
                 models.DateField(
                     help_text=
                     'The date that the Judicial Committee took action on the referral.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_hearing',
                 models.DateField(
                     help_text=
                     'After being nominated, a judge is usually subject to a hearing. This is the date of that hearing.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_confirmation',
                 models.DateField(
                     help_text=
                     'After the hearing the senate will vote on judges. This is the date of that vote.',
                     null=True,
                     db_index=True,
                     blank=True)),
                ('date_start',
                 models.DateField(
                     help_text='The date the position starts active duty.',
                     db_index=True)),
                ('date_granularity_start',
                 models.CharField(max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('date_retirement',
                 models.DateField(db_index=True, null=True, blank=True)),
                ('date_termination',
                 models.DateField(db_index=True, null=True, blank=True)),
                ('date_granularity_termination',
                 models.CharField(blank=True,
                                  max_length=15,
                                  choices=[('%Y', 'Year'), ('%Y-%m', 'Month'),
                                           ('%Y-%m-%d', 'Day')])),
                ('judicial_committee_action',
                 models.CharField(blank=True,
                                  max_length=20,
                                  choices=[('no_rep', 'Not Reported'),
                                           ('rep_w_rec',
                                            'Reported with Recommendation'),
                                           ('rep_wo_rec',
                                            'Reported without Recommendation'),
                                           ('rec_postpone',
                                            'Recommendation Postponed'),
                                           ('rec_bad',
                                            'Recommended Unfavorably')])),
                ('nomination_process',
                 models.CharField(blank=True,
                                  max_length=20,
                                  choices=[('fed_senate', 'U.S. Senate'),
                                           ('state_senate', 'State Senate'),
                                           ('election', 'Primary Election'),
                                           ('merit_comm', 'Merit Commission')
                                           ])),
                ('voice_vote', models.BooleanField(null=True, blank=True)),
                ('votes_yes',
                 models.PositiveSmallIntegerField(null=True, blank=True)),
                ('votes_no',
                 models.PositiveSmallIntegerField(null=True, blank=True)),
                ('how_selected',
                 models.CharField(blank=True,
                                  max_length=20,
                                  choices=[
                                      ('e_part', 'Partisan Election'),
                                      ('e_non_part', 'Non-Partisan Election'),
                                      ('a_pres', 'Appointment (President)'),
                                      ('a_gov', 'Appointment (Governor)'),
                                      ('a_legis', 'Appointment (Legislature)')
                                  ])),
                ('termination_reason',
                 models.CharField(blank=True,
                                  max_length=25,
                                  choices=[
                                      ('ded', 'Death'),
                                      ('retire_vol', 'Voluntary Retirement'),
                                      ('retire_mand', 'Mandatory Retirement'),
                                      ('resign', 'Resigned'),
                                      ('other_pos',
                                       'Appointed to Other Judgeship'),
                                      ('lost', 'Lost Election'),
                                      ('abolished', 'Court Abolished'),
                                      ('bad_judge', 'Impeached and Convicted'),
                                      ('recess_not_confirmed',
                                       'Recess Appointment Not Confirmed')
                                  ])),
                ('appointer',
                 models.ForeignKey(
                     related_name='appointed_positions',
                     blank=True,
                     to='people_db.Person',
                     help_text=
                     'If this is an appointed position, the person responsible for the appointing.',
                     null=True,
                     on_delete=models.CASCADE)),
            ],
        ),
        migrations.CreateModel(
            name='Race',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('race',
                 models.CharField(
                     max_length=5,
                     choices=[
                         ('w', 'White'), ('b', 'Black or African American'),
                         ('i', 'American Indian or Alaska Native'),
                         ('a', 'Asian'),
                         ('p', 'Native Hawaiian or Other Pacific Islander'),
                         ('h', 'Hispanic/Latino')
                     ])),
            ],
        ),
        migrations.CreateModel(
            name='RetentionEvent',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified.',
                     auto_now=True,
                     db_index=True)),
                ('retention_type',
                 models.CharField(max_length=10,
                                  choices=[
                                      ('reapp_gov', 'Governor Reappointment'),
                                      ('reapp_leg',
                                       'Legislative Reappointment'),
                                      ('elec_p', 'Partisan Election'),
                                      ('elec_n', 'Nonpartisan Election'),
                                      ('elec_u', 'Uncontested Election')
                                  ])),
                ('date_retention', models.DateField(db_index=True)),
                ('votes_yes',
                 models.PositiveSmallIntegerField(null=True, blank=True)),
                ('votes_no',
                 models.PositiveSmallIntegerField(null=True, blank=True)),
                ('unopposed', models.BooleanField(null=True, blank=True)),
                ('won', models.BooleanField(null=True, blank=True)),
                ('position',
                 models.ForeignKey(related_name='retention_events',
                                   blank=True,
                                   to='people_db.Position',
                                   null=True,
                                   on_delete=models.CASCADE)),
            ],
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified',
                     auto_now=True,
                     db_index=True)),
                ('name', models.CharField(max_length=120, db_index=True)),
                ('ein',
                 models.IntegerField(help_text='The EIN assigned by the IRS',
                                     null=True,
                                     db_index=True,
                                     blank=True)),
                ('is_alias_of',
                 models.ForeignKey(blank=True,
                                   to='people_db.School',
                                   null=True,
                                   on_delete=models.CASCADE)),
            ],
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('date_created',
                 models.DateTimeField(
                     help_text='The original creation date for the item',
                     auto_now_add=True,
                     db_index=True)),
                ('date_modified',
                 models.DateTimeField(
                     help_text='The last moment when the item was modified',
                     auto_now=True,
                     db_index=True)),
                ('url',
                 models.URLField(
                     help_text='The URL where this data was gathered.',
                     max_length=2000,
                     blank=True)),
                ('date_accessed',
                 models.DateField(help_text='The date the data was gathered.',
                                  null=True,
                                  blank=True)),
                ('notes',
                 models.TextField(
                     help_text=
                     "Any additional notes about the data's provenance, in Markdown format.",
                     blank=True)),
                ('person',
                 models.ForeignKey(related_name='sources',
                                   blank=True,
                                   to='people_db.Person',
                                   null=True,
                                   on_delete=models.CASCADE)),
            ],
        ),
    ]