class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="UserProperties",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("user_locked", models.BooleanField(default=False)),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Patient",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "identifier",
                    localflavor.us.models.USSocialSecurityNumberField(
                        max_length=11, unique=True),
                ),
                ("first_name", models.CharField(max_length=100)),
                ("last_name", models.CharField(max_length=100)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
    ]
class Profile(models.Model):
    user = models.OneToOneField(User,
                                verbose_name=_("User"),
                                on_delete=models.CASCADE,
                                null=True)

    street_address = models.CharField(max_length=128,
                                      default='',
                                      blank=True,
                                      null=True)
    city = models.CharField(max_length=64, default='', blank=True, null=True)
    state = USStateField(default='TX', blank=True, null=True)
    zip_code = USZipCodeField(default='', blank=True, null=True)
    mobile_phone = PhoneNumberField(null=True, default='', blank=True)

    def __str__(self):
        return f"{self.user.first_name} {self.user.last_name}"
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")},
            },
        ),
    ]
Beispiel #4
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)
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',
            },
        ),
    ]
Beispiel #6
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'),
        ),
    ]
Beispiel #7
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',
            },
        ),
    ]