Exemplo n.º 1
0
class ApplicationDecisionOption(models.Model):
    name = models.CharField(max_length=255, unique=True)
    level = models.ManyToManyField(
        AdmissionLevel,
        blank=True,
        null=True,
        help_text="This decision can apply for these levels.")

    def __unicode__(self):
        return unicode(self.name)
class Migration(migrations.Migration):

    dependencies = [
        ('people_db', '0018_auto_20160419_0926'),
    ]

    operations = [
        migrations.AlterField(
            model_name='abarating',
            name='person',
            field=models.ForeignKey(
                related_name='aba_ratings',
                blank=True,
                to='people_db.Person',
                help_text='The person rated by the American Bar Association',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='abarating',
            name='rating',
            field=models.CharField(help_text='The rating given to the person.',
                                   max_length=5,
                                   choices=[
                                       ('ewq', 'Exceptionally Well Qualified'),
                                       ('wq', 'Well Qualified'),
                                       ('q', 'Qualified'),
                                       ('nq', 'Not Qualified'),
                                       ('nqa',
                                        'Not Qualified By Reason of Age')
                                   ]),
        ),
        migrations.AlterField(
            model_name='education',
            name='person',
            field=models.ForeignKey(
                related_name='educations',
                blank=True,
                to='people_db.Person',
                help_text='The person that completed this education',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='education',
            name='school',
            field=models.ForeignKey(
                related_name='educations',
                to='people_db.School',
                help_text='The school where this education was compeleted',
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='person',
            name='date_dob',
            field=models.DateField(
                help_text='The date of birth for the person',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='date_dod',
            field=models.DateField(
                help_text='The date of death for the person',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='dob_city',
            field=models.CharField(
                help_text='The city where the person was born.',
                max_length=50,
                blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='dob_state',
            field=localflavor.us.models.USStateField(
                blank=True,
                help_text='The state where the person was born.',
                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')]),
        ),
        migrations.AlterField(
            model_name='person',
            name='dod_city',
            field=models.CharField(help_text='The city where the person died.',
                                   max_length=50,
                                   blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='dod_state',
            field=localflavor.us.models.USStateField(
                blank=True,
                help_text='The state where the person died.',
                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')]),
        ),
        migrations.AlterField(
            model_name='person',
            name='gender',
            field=models.CharField(blank=True,
                                   help_text="The person's gender",
                                   max_length=2,
                                   choices=[('m', 'Male'), ('f', 'Female'),
                                            ('o', 'Other')]),
        ),
        migrations.AlterField(
            model_name='person',
            name='is_alias_of',
            field=models.ForeignKey(
                related_name='aliases',
                blank=True,
                to='people_db.Person',
                help_text=
                'Any nicknames or other aliases that a person has. For example, William Jefferson Clinton has an alias to Bill',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='person',
            name='name_first',
            field=models.CharField(help_text='The first name of this person.',
                                   max_length=50),
        ),
        migrations.AlterField(
            model_name='person',
            name='name_last',
            field=models.CharField(help_text='The last name of this person',
                                   max_length=50,
                                   db_index=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='name_middle',
            field=models.CharField(
                help_text='The middle name or names of this person',
                max_length=50,
                blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='name_suffix',
            field=models.CharField(
                blank=True,
                help_text="Any suffixes that this person's name may have",
                max_length=5,
                choices=[('jr', 'Jr.'), ('sr', 'Sr.'), ('1', 'I'), ('2', 'II'),
                         ('3', 'III'), ('4', 'IV')]),
        ),
        migrations.AlterField(
            model_name='person',
            name='race',
            field=models.ManyToManyField(
                help_text="A person's race or races if they are multi-racial.",
                to='people_db.Race',
                blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='religion',
            field=models.CharField(help_text='The religion of a person',
                                   max_length=30,
                                   blank=True),
        ),
        migrations.AlterField(
            model_name='person',
            name='slug',
            field=models.SlugField(
                help_text=
                'A generated path for this item as used in CourtListener URLs',
                max_length=158),
        ),
        migrations.AlterField(
            model_name='politicalaffiliation',
            name='date_end',
            field=models.DateField(help_text='The date the affiliation ended.',
                                   null=True,
                                   blank=True),
        ),
        migrations.AlterField(
            model_name='politicalaffiliation',
            name='date_start',
            field=models.DateField(
                help_text=
                'The date the political affiliation was first documented',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='politicalaffiliation',
            name='person',
            field=models.ForeignKey(
                related_name='political_affiliations',
                blank=True,
                to='people_db.Person',
                help_text='The person with the political affiliation',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='politicalaffiliation',
            name='political_party',
            field=models.CharField(
                help_text='The political party the person is affiliated with.',
                max_length=5,
                choices=[('d', 'Democrat'), ('r', 'Republican'),
                         ('i', 'Independent'), ('g', 'Green'),
                         ('l', 'Libertarian'), ('f', 'Federalist'),
                         ('w', 'Whig'), ('j', 'Jeffersonian Republican'),
                         ('u', 'National Union')]),
        ),
        migrations.AlterField(
            model_name='politicalaffiliation',
            name='source',
            field=models.CharField(
                blank=True,
                help_text=
                'The source of the political affiliation -- where it is documented that this affiliation exists.',
                max_length=5,
                choices=[('b', 'Ballot'), ('a', 'Appointer'), ('o', 'Other')]),
        ),
        migrations.AlterField(
            model_name='position',
            name='appointer',
            field=models.ForeignKey(
                related_name='appointed_positions',
                blank=True,
                to='people_db.Position',
                help_text=
                'If this is an appointed position, the person-position responsible for the appointment. This field references other positions instead of referencing people because that allows you to know the position a person held when an appointment was made.',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='position',
            name='court',
            field=models.ForeignKey(
                related_name='court_positions',
                blank=True,
                to='search.Court',
                help_text=
                'If this was a judicial position, this is the jurisdiction where it was held.',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='position',
            name='how_selected',
            field=models.CharField(
                blank=True,
                help_text=
                'The method that was used for selecting this judge for this position (generally an election or appointment).',
                max_length=20,
                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)')))
                ]),
        ),
        migrations.AlterField(
            model_name='position',
            name='job_title',
            field=models.CharField(
                help_text=
                "If title isn't in position_type, a free-text position may be entered here.",
                max_length=100,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='judicial_committee_action',
            field=models.CharField(
                blank=True,
                help_text=
                'The action that the judicial committee took in response to a nomination',
                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')]),
        ),
        migrations.AlterField(
            model_name='position',
            name='nomination_process',
            field=models.CharField(
                blank=True,
                help_text=
                'The process by which a person was nominated into this position.',
                max_length=20,
                choices=[('fed_senate', 'U.S. Senate'),
                         ('state_senate', 'State Senate'),
                         ('election', 'Primary Election'),
                         ('merit_comm', 'Merit Commission')]),
        ),
        migrations.AlterField(
            model_name='position',
            name='organization_name',
            field=models.CharField(
                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,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='person',
            field=models.ForeignKey(
                related_name='positions',
                blank=True,
                to='people_db.Person',
                help_text='The person that held the position.',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='position',
            name='position_type',
            field=models.CharField(
                blank=True,
                max_length=20,
                null=True,
                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.',
                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 of the United States'),
                           ('gov', 'Governor'))),
                         ('Clerkships', (('clerk', 'Clerk'),
                                         ('staff-atty', 'Staff Attorney'))),
                         ('prof', 'Professor'), ('prac', 'Practitioner'),
                         ('pros', 'Prosecutor'),
                         ('pub_def', 'Public Defender'),
                         ('legis', 'Legislator')]),
        ),
        migrations.AlterField(
            model_name='position',
            name='predecessor',
            field=models.ForeignKey(
                blank=True,
                to='people_db.Person',
                help_text='The person that previously held this position',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='position',
            name='school',
            field=models.ForeignKey(
                blank=True,
                to='people_db.School',
                help_text=
                'If this was an academic job, this is the school where the person worked.',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='position',
            name='termination_reason',
            field=models.CharField(blank=True,
                                   help_text='The reason for a termination',
                                   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')
                                   ]),
        ),
        migrations.AlterField(
            model_name='position',
            name='voice_vote',
            field=models.BooleanField(
                help_text=
                'Whether the Senate voted by voice vote for this position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='vote_type',
            field=models.CharField(
                blank=True,
                help_text='The type of vote that resulted in this position.',
                max_length=2,
                choices=[('s', 'Senate'), ('p', 'Partisan Election'),
                         ('np', 'Non-Partisan Election')]),
        ),
        migrations.AlterField(
            model_name='position',
            name='votes_no',
            field=models.PositiveIntegerField(
                help_text=
                'If votes are an integer, this is the number of votes opposed to a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='votes_no_percent',
            field=models.FloatField(
                help_text=
                'If votes are a percentage, this is the percentage of votes opposed to a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='votes_yes',
            field=models.PositiveIntegerField(
                help_text=
                'If votes are an integer, this is the number of votes in favor of a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='position',
            name='votes_yes_percent',
            field=models.FloatField(
                help_text=
                'If votes are a percentage, this is the percentage of votes in favor of a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='date_retention',
            field=models.DateField(help_text='The date of retention',
                                   db_index=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='position',
            field=models.ForeignKey(
                related_name='retention_events',
                blank=True,
                to='people_db.Position',
                help_text='The position that was retained by this event.',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='retention_type',
            field=models.CharField(
                help_text=
                'The method through which this position was retained.',
                max_length=10,
                choices=[('reapp_gov', 'Governor Reappointment'),
                         ('reapp_leg', 'Legislative Reappointment'),
                         ('elec_p', 'Partisan Election'),
                         ('elec_n', 'Nonpartisan Election'),
                         ('elec_u', 'Uncontested Election')]),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='unopposed',
            field=models.BooleanField(
                help_text=
                'Whether the position was unopposed at the time of retention.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='votes_no',
            field=models.PositiveIntegerField(
                help_text=
                'If votes are an integer, this is the number of votes opposed to a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='votes_no_percent',
            field=models.FloatField(
                help_text=
                'If votes are a percentage, this is the percentage of votes opposed to a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='votes_yes',
            field=models.PositiveIntegerField(
                help_text=
                'If votes are an integer, this is the number of votes in favor of a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='votes_yes_percent',
            field=models.FloatField(
                help_text=
                'If votes are a percentage, this is the percentage of votes in favor of a position.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='retentionevent',
            name='won',
            field=models.BooleanField(
                help_text='Whether the retention event was won.',
                null=True,
                blank=True),
        ),
        migrations.AlterField(
            model_name='school',
            name='is_alias_of',
            field=models.ForeignKey(
                blank=True,
                to='people_db.School',
                help_text='Any alternate names that a school may have',
                null=True,
                on_delete=models.CASCADE),
        ),
        migrations.AlterField(
            model_name='school',
            name='name',
            field=models.CharField(help_text='The name of the school or alias',
                                   max_length=120,
                                   db_index=True),
        ),
    ]
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="Course",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("specifics", models.TextField()),
                ("capacity", models.PositiveSmallIntegerField()),
                ("expected_capacity", models.PositiveIntegerField()),
                ("shown", models.BooleanField(default=True)),
                (
                    "instructors",
                    models.ManyToManyField(
                        blank=True,
                        related_name="instructors",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "participants",
                    models.ManyToManyField(
                        blank=True,
                        related_name="participants",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="CourseType",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("name", models.CharField(max_length=300)),
                ("abbreviation", models.CharField(max_length=5)),
                ("description", models.TextField(blank=True)),
                ("visible", models.BooleanField(default=True)),
                ("cost", models.PositiveIntegerField()),
                (
                    "requirement",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="registration.coursetype",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Discount",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("number_of_courses",
                 models.PositiveSmallIntegerField(unique=True)),
                ("discount", models.PositiveIntegerField()),
                ("stripe_id", models.CharField(max_length=50)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="EarlySignupEmail",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("email", models.EmailField(max_length=254)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="RegistrationSettings",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("early_registration_open", models.DateTimeField()),
                ("early_signup_code",
                 models.CharField(blank=True, max_length=15)),
                ("registration_open", models.DateTimeField()),
                ("registration_close", models.DateTimeField()),
                (
                    "refund_period",
                    models.DurationField(default=datetime.timedelta(days=14)),
                ),
                ("cancellation_fee", models.PositiveIntegerField()),
                (
                    "time_to_pay_invoice",
                    models.DurationField(default=datetime.timedelta(days=2)),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="WaitListInvoice",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("date_added", models.DateTimeField(auto_now_add=True)),
                ("email", models.CharField(max_length=200)),
                ("expires", models.DateTimeField()),
                ("invoice_id", models.CharField(max_length=200)),
                ("paid", models.BooleanField(default=False)),
                ("voided", models.BooleanField(default=False)),
                (
                    "course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="registration.course",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="UserCart",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="RegistrationForm",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("address", models.CharField(max_length=300)),
                ("address_2", models.CharField(blank=True, max_length=300)),
                ("city", models.CharField(max_length=100)),
                ("state", localflavor.us.models.USStateField(max_length=2)),
                ("zip_code",
                 localflavor.us.models.USZipCodeField(max_length=10)),
                (
                    "phone_1",
                    phonenumber_field.modelfields.PhoneNumberField(
                        max_length=128, region=None),
                ),
                (
                    "phone_2",
                    phonenumber_field.modelfields.PhoneNumberField(
                        blank=True, max_length=128, region=None),
                ),
                ("date_of_birth", models.DateField()),
                (
                    "gender",
                    models.CharField(
                        choices=[
                            ("M", "Male"),
                            ("F", "Female"),
                            ("N", "Non-Binary"),
                            ("U", "Does not wish to identify"),
                        ],
                        max_length=1,
                    ),
                ),
                ("pronouns", models.CharField(blank=True, max_length=30)),
                ("emergency_contact_name", models.CharField(max_length=200)),
                (
                    "emergency_contact_relationship_to_you",
                    models.CharField(max_length=200),
                ),
                (
                    "emergency_contact_phone_number",
                    phonenumber_field.modelfields.PhoneNumberField(
                        max_length=128, region=None),
                ),
                ("physical_fitness", models.TextField()),
                ("medical_condition_description",
                 models.TextField(blank=True)),
                ("allergy_condition_description",
                 models.TextField(blank=True)),
                ("medications_descriptions", models.TextField(blank=True)),
                ("medical_insurance", models.BooleanField()),
                ("name_of_policy_holder", models.CharField(max_length=200)),
                ("relation_of_policy_holder",
                 models.CharField(max_length=100)),
                ("signature", models.CharField(max_length=3)),
                ("todays_date", models.DateField()),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("email_confirmed", models.BooleanField(default=False)),
                ("stripe_customer_id", models.CharField(max_length=200)),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="PaymentRecord",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("checkout_session_id",
                 models.CharField(blank=True, max_length=200)),
                ("payment_intent_id",
                 models.CharField(blank=True, max_length=200)),
                ("invoice_id", models.CharField(blank=True, max_length=200)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="GearItem",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("item", models.CharField(max_length=300)),
                (
                    "type",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="registration.coursetype",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="CourseDate",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("start", models.DateTimeField()),
                ("end", models.DateTimeField()),
                (
                    "course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="registration.course",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="CourseBought",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("product_id", models.CharField(max_length=200)),
                ("price_id", models.CharField(max_length=200)),
                ("refunded", models.BooleanField(default=False)),
                ("refund_id", models.CharField(blank=True, max_length=200)),
                (
                    "course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="registration.course",
                    ),
                ),
                (
                    "payment_record",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="registration.paymentrecord",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="course",
            name="type",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="registration.coursetype",
            ),
        ),
        migrations.CreateModel(
            name="CartItem",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "cart",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="registration.usercart",
                    ),
                ),
                (
                    "course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="registration.course",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="WaitList",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("date_added", models.DateTimeField(auto_now_add=True)),
                (
                    "course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="registration.course",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "unique_together": {("course", "user")},
            },
        ),
    ]
Exemplo n.º 4
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",
            ),
        ),
    ]
Exemplo n.º 5
0
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)
Exemplo n.º 6
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='BarMembership',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('barMembership',
                 localflavor.us.models.USStateField(
                     max_length=2,
                     verbose_name=
                     'the two letter state abbreviation of a bar membership',
                     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')
                     ])),
            ],
            options={
                'ordering': ['barMembership'],
                'verbose_name': 'bar membership',
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('stub_account', models.BooleanField(default=False)),
                ('employer',
                 models.CharField(max_length=100,
                                  null=True,
                                  verbose_name="the user's employer",
                                  blank=True)),
                ('address1',
                 models.CharField(max_length=100, null=True, blank=True)),
                ('address2',
                 models.CharField(max_length=100, null=True, blank=True)),
                ('city', models.CharField(max_length=50, null=True,
                                          blank=True)),
                ('state', models.CharField(max_length=2, null=True,
                                           blank=True)),
                ('zip_code',
                 models.CharField(max_length=10, null=True, blank=True)),
                ('avatar',
                 models.ImageField(upload_to='avatars/%Y/%m/%d',
                                   verbose_name="the user's avatar",
                                   blank=True)),
                ('wants_newsletter',
                 models.BooleanField(
                     default=False,
                     verbose_name='This user wants newsletters')),
                ('plaintext_preferred',
                 models.BooleanField(
                     default=False,
                     verbose_name='should the alert should be sent in plaintext'
                 )),
                ('activation_key', models.CharField(max_length=40)),
                ('key_expires',
                 models.DateTimeField(
                     null=True,
                     verbose_name=
                     "The time and date when the user's activation_key expires",
                     blank=True)),
                ('email_confirmed',
                 models.BooleanField(
                     default=False,
                     verbose_name='The user has confirmed their email address')
                 ),
                ('barmembership',
                 models.ManyToManyField(
                     to='users.BarMembership',
                     verbose_name='the bar memberships held by the user',
                     blank=True)),
                ('user',
                 models.OneToOneField(
                     related_name='profile',
                     verbose_name='the user this model extends',
                     to=settings.AUTH_USER_MODEL,
                     on_delete=models.CASCADE)),
            ],
            options={
                'verbose_name': 'user profile',
                'verbose_name_plural': 'user profiles',
            },
        ),
    ]
Exemplo n.º 7
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'),
        ),
    ]
Exemplo n.º 8
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='BarMembership',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('barMembership',
                 localflavor.us.models.USStateField(
                     max_length=2,
                     verbose_name=
                     'the two letter state abbreviation of a bar membership')),
            ],
            options={
                'verbose_name': 'bar membership',
                'ordering': ['barMembership'],
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('stub_account', models.BooleanField(default=False)),
                ('employer',
                 models.CharField(blank=True,
                                  help_text="the user's employer",
                                  max_length=100,
                                  null=True)),
                ('address1',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('address2',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('city', models.CharField(blank=True, max_length=50,
                                          null=True)),
                ('state', models.CharField(blank=True, max_length=2,
                                           null=True)),
                ('zip_code',
                 models.CharField(blank=True, max_length=10, null=True)),
                ('avatar',
                 models.ImageField(blank=True,
                                   help_text="the user's avatar",
                                   upload_to='avatars/%Y/%m/%d')),
                ('wants_newsletter',
                 models.BooleanField(default=False,
                                     help_text='This user wants newsletters')),
                ('unlimited_docket_alerts',
                 models.BooleanField(
                     default=False,
                     help_text='Should the user get unlimited docket alerts?')
                 ),
                ('plaintext_preferred',
                 models.BooleanField(
                     default=False,
                     help_text='should the alert should be sent in plaintext')
                 ),
                ('activation_key', models.CharField(max_length=40)),
                ('key_expires',
                 models.DateTimeField(
                     blank=True,
                     help_text=
                     "The time and date when the user's activation_key expires",
                     null=True)),
                ('email_confirmed',
                 models.BooleanField(
                     default=False,
                     help_text='The user has confirmed their email address')),
                ('notes',
                 models.TextField(blank=True,
                                  help_text='Any notes about the user.')),
                ('is_tester',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'The user tests new features before they are finished')),
                ('barmembership',
                 models.ManyToManyField(
                     blank=True,
                     to='users.BarMembership',
                     verbose_name='the bar memberships held by the user')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='the user this model extends')),
            ],
            options={
                'verbose_name': 'user profile',
                'verbose_name_plural': 'user profiles',
            },
        ),
    ]