-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* created HealthInfo admin and model -- not working * created health dashboard in admin view * updated migrations --------- Co-authored-by: johnlhuangP <[email protected]>
- Loading branch information
1 parent
f1e6c7a
commit e3430f4
Showing
9 changed files
with
371 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
Oops, something went wrong.