From e3430f438597143103197367aa2bf78e45771b25 Mon Sep 17 00:00:00 2001 From: Charles Tang <75450612+charlestang06@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:26:42 -0400 Subject: [PATCH] Health dashboard (#29) * created HealthInfo admin and model -- not working * created health dashboard in admin view * updated migrations --------- Co-authored-by: johnlhuangP --- necysc_app/admin.py | 30 +- necysc_app/migrations/0001_initial.py | 378 ++++++++++++++++-- ...pplicant_allergies_description_and_more.py | 325 --------------- .../0003_alter_applicant_group_id_and_more.py | 28 -- ...email_remove_applicant_user_pw_and_more.py | 37 -- ...pplicant_allergies_description_and_more.py | 58 --- .../migrations/0005_merge_20241015_1531.py | 14 - ...pplicant_allergies_description_and_more.py | 73 ---- necysc_app/models.py | 7 +- 9 files changed, 371 insertions(+), 579 deletions(-) delete mode 100644 necysc_app/migrations/0002_applicant_allergies_applicant_allergies_description_and_more.py delete mode 100644 necysc_app/migrations/0003_alter_applicant_group_id_and_more.py delete mode 100644 necysc_app/migrations/0003_remove_applicant_user_email_remove_applicant_user_pw_and_more.py delete mode 100644 necysc_app/migrations/0004_alter_applicant_allergies_description_and_more.py delete mode 100644 necysc_app/migrations/0005_merge_20241015_1531.py delete mode 100644 necysc_app/migrations/0006_alter_applicant_allergies_description_and_more.py diff --git a/necysc_app/admin.py b/necysc_app/admin.py index 0948054c..f333590a 100644 --- a/necysc_app/admin.py +++ b/necysc_app/admin.py @@ -1,23 +1,25 @@ +# admin.py from django.contrib import admin -from .models import Applicant -from .models import GlobalData +from .models import Applicant, ApplicantHealth, GlobalData from solo.admin import SingletonModelAdmin class ApplicantAdmin(admin.ModelAdmin): - # allows search by first name or last name search_fields = ['applicant_fname', 'applicant_lname'] + list_display = ['applicant_fname', 'applicant_lname', 'applicant_bday', 'last_updated_at', + 'program', 'group_id', 'room_id', 'applicant_sex', 'app_status', 'payment_received', + 'health_record_status', 'parent1_fname', 'parent1_lname', 'parent1_email', + 'parent1_phone', 'applicant_shirt_size', 'referrals', 'preferred_roommate'] + list_filter = ['app_year', 'program', 'group_id', 'room_id', 'applicant_sex', 'app_status', + 'payment_received', 'health_record_status', 'applicant_shirt_size', 'referrals', + 'preferred_roommate'] - # should the time of app refer to the creation time or time last updated? - list_display =['applicant_fname', 'applicant_lname', 'applicant_bday', 'last_updated_at', - 'program', 'group_id', 'room_id', 'applicant_sex', 'app_status', 'payment_received', - 'health_record_status', 'parent1_fname', 'parent1_lname', 'parent1_email', 'parent1_phone', - 'applicant_shirt_size', 'referrals', 'preferred_roommate'] - - # filter selector based on year - list_filter = ['app_year', 'program', 'group_id', 'room_id', 'applicant_sex', 'app_status', 'payment_received', - 'health_record_status', 'applicant_shirt_size', 'referrals', 'preferred_roommate'] +class HealthInfoAdmin(admin.ModelAdmin): + search_fields = ['applicant_fname', 'applicant_lname'] + + list_display = ['applicant_fname', 'applicant_lname', 'applicant_bday', 'created_at', + 'program', 'applicant_sex', 'health_form_a_received', 'health_form_b_received'] -# Register your models here. +# Register the base model, proxy model, and global data model admin.site.register(Applicant, ApplicantAdmin) +admin.site.register(ApplicantHealth, HealthInfoAdmin) admin.site.register(GlobalData, SingletonModelAdmin) - diff --git a/necysc_app/migrations/0001_initial.py b/necysc_app/migrations/0001_initial.py index e4fa96a5..9d3c4719 100644 --- a/necysc_app/migrations/0001_initial.py +++ b/necysc_app/migrations/0001_initial.py @@ -1,12 +1,18 @@ +# Generated by Django 5.1.1 on 2024-10-27 21:12 + import django.core.validators +import django.db.models.deletion +from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True - - dependencies = [] + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] operations = [ migrations.CreateModel( @@ -21,8 +27,6 @@ class Migration(migrations.Migration): verbose_name="ID", ), ), - ("user_email", models.EmailField(max_length=254)), - ("user_pw", models.CharField(max_length=200)), ("created_at", models.DateTimeField(auto_now_add=True)), ("last_updated_at", models.DateTimeField(auto_now=True)), ("app_year", models.IntegerField(default=2024)), @@ -35,6 +39,7 @@ class Migration(migrations.Migration): ("P", "Pending"), ("I", "Incomplete"), ], + default="I", max_length=1, ), ), @@ -50,32 +55,80 @@ class Migration(migrations.Migration): max_length=2, ), ), - ("applicant_fname", models.CharField(max_length=200)), - ("applicant_lname", models.CharField(max_length=200)), + ( + "applicant_fname", + models.CharField(max_length=200, verbose_name="First Name"), + ), + ( + "applicant_lname", + models.CharField(max_length=200, verbose_name="Last Name"), + ), ( "applicant_chinese_name", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Chinese Name", + ), + ), + ( + "applicant_email", + models.EmailField(max_length=254, verbose_name="Email"), + ), + ( + "parent1_fname", + models.CharField( + max_length=200, verbose_name="Primary Contact First Name" + ), + ), + ( + "parent1_lname", + models.CharField( + max_length=200, verbose_name="Primary Contact Last Name" + ), ), - ("applicant_email", models.EmailField(max_length=254)), - ("parent1_fname", models.CharField(max_length=200)), - ("parent1_lname", models.CharField(max_length=200)), ( "parent1_relationship", models.CharField( choices=[("F", "Father"), ("M", "Mother"), ("G", "Guardian")], max_length=1, + verbose_name="Primary Contact Relationship", ), ), - ("parent1_phone", models.CharField(max_length=15)), - ("parent1_email", models.EmailField(max_length=254)), - ("parent1_for_POD", models.BooleanField()), + ( + "parent1_phone", + models.CharField( + max_length=15, verbose_name="Primary Contact Phone" + ), + ), + ( + "parent1_email", + models.EmailField( + max_length=254, verbose_name="Primary Contact Email" + ), + ), + ( + "parent1_for_POD", + models.BooleanField(verbose_name="Primary Contact as POD"), + ), ( "parent2_fname", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Secondary Contact First Name", + ), ), ( "parent2_lname", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Secondary Contact Last Name", + ), ), ( "parent2_relationship", @@ -84,50 +137,94 @@ class Migration(migrations.Migration): choices=[("F", "Father"), ("M", "Mother"), ("G", "Guardian")], max_length=1, null=True, + verbose_name="Secondary Contact Relationship", ), ), ( "parent2_phone", - models.CharField(blank=True, max_length=15, null=True), + models.CharField( + blank=True, + max_length=15, + null=True, + verbose_name="Secondary Contact Phone", + ), ), ( "parent2_email", - models.EmailField(blank=True, max_length=254, null=True), + models.EmailField( + blank=True, + max_length=254, + null=True, + verbose_name="Secondary Contact Email", + ), + ), + ( + "parent2_for_POD", + models.BooleanField( + blank=True, null=True, verbose_name="Secondary Contact as POD" + ), + ), + ( + "interest_in_POD_lead", + models.BooleanField(verbose_name="Interest in POD Lead"), ), - ("parent2_for_POD", models.BooleanField(blank=True, null=True)), - ("interest_in_POD_lead", models.BooleanField()), ( "additional_emergency_contact_fname", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Emergency Contact First Name", + ), ), ( "additional_emergency_contact_lname", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Emergency Contact Last Name", + ), ), ( "additional_emergency_contact_relationship", - models.CharField(blank=True, max_length=200, null=True), + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Emergency Contact Relationship", + ), ), ( "additional_emergency_contact_phone", - models.CharField(blank=True, max_length=15, null=True), + models.CharField( + blank=True, + max_length=15, + null=True, + verbose_name="Emergency Contact Phone", + ), + ), + ( + "street_address", + models.CharField(max_length=200, verbose_name="Street"), ), - ("street_address", models.CharField(max_length=200)), - ("city", models.CharField(max_length=200)), - ("state", models.CharField(max_length=200)), - ("zip_code", models.CharField(max_length=200)), - ("applicant_bday", models.DateField()), + ("city", models.CharField(max_length=200, verbose_name="City")), + ("state", models.CharField(max_length=200, verbose_name="State")), + ("zip_code", models.CharField(max_length=200, verbose_name="Zip Code")), + ("applicant_bday", models.DateField(verbose_name="Birthday")), ( "applicant_sex", models.CharField( choices=[("M", "Male"), ("F", "Female"), ("O", "Other")], max_length=1, + verbose_name="Gender", ), ), ( "applicant_grade", models.IntegerField( - validators=[django.core.validators.MinValueValidator(0)] + validators=[django.core.validators.MinValueValidator(0)], + verbose_name="School Grade", ), ), ( @@ -143,8 +240,231 @@ class Migration(migrations.Migration): ("AX", "Adult XL"), ], max_length=2, + verbose_name="T-Shirt Size", + ), + ), + ( + "program", + models.CharField( + choices=[ + ("D", "Day"), + ("ON", "Overnight"), + ("CIT", "CIT"), + ("C", "Counselor"), + ("EA", "EA"), + ], + default="ON", + max_length=3, + verbose_name="Program", + ), + ), + ("payment_received", models.BooleanField(default=False)), + ( + "payment_total", + models.DecimalField(decimal_places=2, default=0, max_digits=10), + ), + ( + "payment_camp", + models.DecimalField(decimal_places=2, default=0, max_digits=10), + ), + ( + "payment_donation", + models.DecimalField( + blank=True, + decimal_places=2, + default=0, + max_digits=10, + null=True, + ), + ), + ( + "payment_pod", + models.DecimalField( + blank=True, + decimal_places=2, + default=0, + max_digits=10, + null=True, + ), + ), + ( + "allowed_pickup_persons", + models.CharField(blank=True, max_length=500, null=True), + ), + ("financial_aid_requested", models.BooleanField(default=False)), + ("listing_on_weekbook", models.BooleanField(default=False)), + ( + "camper_contact_email", + models.EmailField(blank=True, max_length=254, null=True), + ), + ("interest_in_committee", models.BooleanField(default=False)), + ("interest_in_wkbook_ads", models.BooleanField(default=False)), + ("available_for_carpool", models.BooleanField(default=False)), + ("referrals", models.CharField(blank=True, max_length=200, null=True)), + ("heard_from", models.CharField(blank=True, max_length=200, null=True)), + ( + "preferred_roommate", + models.CharField(blank=True, max_length=200, null=True), + ), + ( + "health_form_a_received", + models.CharField( + choices=[ + ("NS", "Not Submitted"), + ("P", "Pending"), + ("A", "Approved"), + ], + default="NS", + max_length=10, + ), + ), + ("health_form_b_received", models.BooleanField(default=False)), + ("medication_slip_received", models.BooleanField(default=False)), + ( + "parent1_cori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "parent1_sori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "parent1_id_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "parent2_cori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "parent2_sori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "parent2_id_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "camper_cori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "camper_sori_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ( + "camper_id_status", + models.CharField(blank=True, max_length=10, null=True), + ), + ("camp_rule_agreement", models.BooleanField(default=False)), + ("liability_agreement", models.BooleanField(default=False)), + ( + "insurance_provider", + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Health Insurance Provider", + ), + ), + ( + "subscriber_name", + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Insurance Subscriber Name", + ), + ), + ( + "primary_physician_name", + models.CharField( + blank=True, + max_length=200, + null=True, + verbose_name="Physician Name", + ), + ), + ( + "primary_physician_phone", + models.CharField( + blank=True, + max_length=15, + null=True, + verbose_name="Physician Phone", + ), + ), + ("grant_hospital_permission", models.BooleanField(default=False)), + ( + "grant_medical_treatment_permission", + models.BooleanField(default=False), + ), + ("grant_first_aid_permission", models.BooleanField(default=False)), + ("grant_meds_permission", models.BooleanField(default=False)), + ("grant_bug_spray_permission", models.BooleanField(default=False)), + ("grant_skin_treatment_permission", models.BooleanField(default=False)), + ("allergies", models.BooleanField(default=False)), + ( + "allergies_description", + models.CharField(blank=True, max_length=200, null=True), + ), + ( + "initial_for_allergy_treatment", + models.CharField(blank=True, max_length=200, null=True), + ), + ("epi_pen_prescribed", models.BooleanField(default=False)), + ( + "social_emotional_concerns", + models.CharField(blank=True, max_length=200, null=True), + ), + ("wear_glasses", models.BooleanField(default=False)), + ("wear_contacts", models.BooleanField(default=False)), + ("wear_hearing_aids", models.BooleanField(default=False)), + ("medication", models.BooleanField(default=False)), + ( + "medication_description", + models.CharField(blank=True, max_length=200, null=True), + ), + ( + "opt_out_activities", + models.CharField(blank=True, max_length=200, null=True), + ), + ( + "medical_comments", + models.CharField(blank=True, max_length=200, null=True), + ), + ("signature", models.CharField(blank=True, max_length=200, null=True)), + ( + "group_id", + models.CharField( + blank=True, default="0", max_length=200, null=True + ), + ), + ("room_id", models.CharField(blank=True, max_length=200, null=True)), + ( + "internal_comments", + models.CharField(blank=True, max_length=200, null=True), + ), + ( + "user", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, ), ), ], ), + migrations.CreateModel( + name="ApplicantHealth", + fields=[], + options={ + "verbose_name": "Applicant Health Info", + "proxy": True, + "indexes": [], + "constraints": [], + }, + bases=("necysc_app.applicant",), + ), ] diff --git a/necysc_app/migrations/0002_applicant_allergies_applicant_allergies_description_and_more.py b/necysc_app/migrations/0002_applicant_allergies_applicant_allergies_description_and_more.py deleted file mode 100644 index 0e3507e5..00000000 --- a/necysc_app/migrations/0002_applicant_allergies_applicant_allergies_description_and_more.py +++ /dev/null @@ -1,325 +0,0 @@ -# Generated by Django 5.0.2 on 2024-10-15 00:51 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("necysc_app", "0001_initial"), - ] - - operations = [ - migrations.AddField( - model_name="applicant", - name="allergies", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="allergies_description", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="allowed_pickup_persons", - field=models.CharField(blank=True, max_length=500, null=True), - ), - migrations.AddField( - model_name="applicant", - name="available_for_carpool", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="camp_rule_agreement", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="camper_contact_email", - field=models.EmailField(blank=True, max_length=254, null=True), - ), - migrations.AddField( - model_name="applicant", - name="camper_cori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="camper_id_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="camper_sori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="epi_pen_prescribed", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="financial_aid_requested", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_bug_spray_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_first_aid_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_hospital_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_medical_treatment_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_meds_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="grant_skin_treatment_permission", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="group_id", - field=models.CharField(blank=True, default="0", max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="health_form_a_received", - field=models.CharField( - choices=[("NS", "Not Submitted"), ("P", "Pending"), ("A", "Approved")], - default="NS", - max_length=10, - ), - ), - migrations.AddField( - model_name="applicant", - name="health_form_b_received", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="heard_from", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="initial_for_allergy_treatment", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="insurance_provider", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="interest_in_committee", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="interest_in_wkbook_ads", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="internal_comments", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="liability_agreement", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="listing_on_weekbook", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="medical_comments", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="medication", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="medication_description", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="medication_slip_received", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="opt_out_activities", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent1_cori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent1_id_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent1_sori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent2_cori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent2_id_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="parent2_sori_status", - field=models.CharField(blank=True, max_length=10, null=True), - ), - migrations.AddField( - model_name="applicant", - name="payment_camp", - field=models.DecimalField(decimal_places=2, default=0, max_digits=10), - ), - migrations.AddField( - model_name="applicant", - name="payment_donation", - field=models.DecimalField( - blank=True, decimal_places=2, default=0, max_digits=10, null=True - ), - ), - migrations.AddField( - model_name="applicant", - name="payment_pod", - field=models.DecimalField( - blank=True, decimal_places=2, default=0, max_digits=10, null=True - ), - ), - migrations.AddField( - model_name="applicant", - name="payment_received", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="payment_total", - field=models.DecimalField(decimal_places=2, default=0, max_digits=10), - ), - migrations.AddField( - model_name="applicant", - name="preferred_roommate", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="primary_physician_name", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="primary_physician_phone", - field=models.CharField(blank=True, max_length=15, null=True), - ), - migrations.AddField( - model_name="applicant", - name="program", - field=models.CharField( - choices=[ - ("D", "Day"), - ("ON", "Overnight"), - ("CIT", "CIT"), - ("C", "Counselor"), - ("EA", "EA"), - ], - default="ON", - max_length=3, - ), - ), - migrations.AddField( - model_name="applicant", - name="referrals", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="room_id", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="signature", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="social_emotional_concerns", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="subscriber_name", - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AddField( - model_name="applicant", - name="wear_contacts", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="wear_glasses", - field=models.BooleanField(default=False), - ), - migrations.AddField( - model_name="applicant", - name="wear_hearing_aids", - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name="applicant", - name="app_status", - field=models.CharField( - choices=[ - ("A", "Accepted"), - ("D", "Denied"), - ("P", "Pending"), - ("I", "Incomplete"), - ], - default="I", - max_length=1, - ), - ), - ] diff --git a/necysc_app/migrations/0003_alter_applicant_group_id_and_more.py b/necysc_app/migrations/0003_alter_applicant_group_id_and_more.py deleted file mode 100644 index 9da9063a..00000000 --- a/necysc_app/migrations/0003_alter_applicant_group_id_and_more.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-14 16:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('necysc_app', '0002_applicant_allergies_applicant_allergies_description_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='applicant', - name='group_id', - field=models.IntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='payment_camp', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='payment_total', - field=models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True), - ), - ] diff --git a/necysc_app/migrations/0003_remove_applicant_user_email_remove_applicant_user_pw_and_more.py b/necysc_app/migrations/0003_remove_applicant_user_email_remove_applicant_user_pw_and_more.py deleted file mode 100644 index 7fd0c1ac..00000000 --- a/necysc_app/migrations/0003_remove_applicant_user_email_remove_applicant_user_pw_and_more.py +++ /dev/null @@ -1,37 +0,0 @@ -# Generated by Django 5.0.2 on 2024-10-15 00:52 - -import django.db.models.deletion -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "necysc_app", - "0002_applicant_allergies_applicant_allergies_description_and_more", - ), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.RemoveField( - model_name="applicant", - name="user_email", - ), - migrations.RemoveField( - model_name="applicant", - name="user_pw", - ), - migrations.AddField( - model_name="applicant", - name="user", - field=models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.CASCADE, - to=settings.AUTH_USER_MODEL, - ), - ), - ] diff --git a/necysc_app/migrations/0004_alter_applicant_allergies_description_and_more.py b/necysc_app/migrations/0004_alter_applicant_allergies_description_and_more.py deleted file mode 100644 index 39ceac8e..00000000 --- a/necysc_app/migrations/0004_alter_applicant_allergies_description_and_more.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-14 16:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('necysc_app', '0003_alter_applicant_group_id_and_more'), - ] - - operations = [ - migrations.AlterField( - model_name='applicant', - name='allergies_description', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='initial_for_allergy_treatment', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='insurance_provider', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='medication_description', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='primary_physician_name', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='primary_physician_phone', - field=models.CharField(blank=True, max_length=15), - ), - migrations.AlterField( - model_name='applicant', - name='program', - field=models.CharField(blank=True, choices=[('D', 'Day'), ('O', 'Overnight'), ('CIT', 'CIT'), ('C', 'Counselor'), ('EA', 'EA')], max_length=3, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='signature', - field=models.CharField(blank=True, max_length=200), - ), - migrations.AlterField( - model_name='applicant', - name='subscriber_name', - field=models.CharField(blank=True, max_length=200), - ), - ] diff --git a/necysc_app/migrations/0005_merge_20241015_1531.py b/necysc_app/migrations/0005_merge_20241015_1531.py deleted file mode 100644 index d1bbb3db..00000000 --- a/necysc_app/migrations/0005_merge_20241015_1531.py +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-15 19:31 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('necysc_app', '0003_remove_applicant_user_email_remove_applicant_user_pw_and_more'), - ('necysc_app', '0004_alter_applicant_allergies_description_and_more'), - ] - - operations = [ - ] diff --git a/necysc_app/migrations/0006_alter_applicant_allergies_description_and_more.py b/necysc_app/migrations/0006_alter_applicant_allergies_description_and_more.py deleted file mode 100644 index 4e2bab00..00000000 --- a/necysc_app/migrations/0006_alter_applicant_allergies_description_and_more.py +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by Django 5.1.1 on 2024-10-15 19:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('necysc_app', '0005_merge_20241015_1531'), - ] - - operations = [ - migrations.AlterField( - model_name='applicant', - name='allergies_description', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='group_id', - field=models.CharField(blank=True, default='0', max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='initial_for_allergy_treatment', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='insurance_provider', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='medication_description', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='payment_camp', - field=models.DecimalField(decimal_places=2, default=0, max_digits=10), - ), - migrations.AlterField( - model_name='applicant', - name='payment_total', - field=models.DecimalField(decimal_places=2, default=0, max_digits=10), - ), - migrations.AlterField( - model_name='applicant', - name='primary_physician_name', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='primary_physician_phone', - field=models.CharField(blank=True, max_length=15, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='program', - field=models.CharField(choices=[('D', 'Day'), ('ON', 'Overnight'), ('CIT', 'CIT'), ('C', 'Counselor'), ('EA', 'EA')], default='ON', max_length=3), - ), - migrations.AlterField( - model_name='applicant', - name='signature', - field=models.CharField(blank=True, max_length=200, null=True), - ), - migrations.AlterField( - model_name='applicant', - name='subscriber_name', - field=models.CharField(blank=True, max_length=200, null=True), - ), - ] diff --git a/necysc_app/models.py b/necysc_app/models.py index cdcf976f..8abd4e31 100644 --- a/necysc_app/models.py +++ b/necysc_app/models.py @@ -7,7 +7,6 @@ -# TODO: should we make this a forms.ModelForm? class Applicant(models.Model): # choices for application status APP_STATUS_CHOICES = { @@ -214,6 +213,12 @@ class Applicant(models.Model): room_id = models.CharField(max_length=200, blank=True, null=True) internal_comments = models.CharField(max_length=200, blank=True, null=True) +class ApplicantHealth(Applicant): + class Meta: + proxy = True + app_label = Applicant._meta.app_label + verbose_name = "Applicant Health Info" + class GlobalData(SingletonModel): day_camp_cost = models.DecimalField(max_digits=10, decimal_places=2, default=0) ON_camp_cost = models.DecimalField(max_digits=10, decimal_places=2, default=0)