I am working on building a management interface for an ESL (English as a Second Language) institute, basically it is a language school where people learn English.
I have prepared my models for each app and I really would like someone to review them and provide me with suggestions and possible mistakes in the design.
- the models for an app called ez_core:
GENDER_CHOICES = [
('Female', 'Female'),
('Male', 'Male')
]
STREET_ADDRESS_CHOICES = [
('A', 'A'),
('B', 'B')
]
EDUCATIONAL_LEVEL_CHOICES = [
('Bachelor\'s Degree', 'Bachelor\'s Degree'),
('Master\'s Degree', 'Master\'s Degree'),
('PhD Degree', 'PhD Degree'),
]
CONTACT_RELATIONSHIP_CHOICES = [
('Brother', 'Brother'),
('Father', 'Father'),
('Mother', 'Mother'),
('Sister', 'Sister'),
('Uncle', 'Uncle'),
('Wife', 'Wife'),
]
MEDICAL_CONDITION_CHOICES = [
('Chronic Disease', 'Chronic Disease'),
('Allergies', 'Allergies')
]
class PersonalInfo(models.Model):
full_name = models.CharField(max_length=100)
phone_number = models.CharField(max_length=100)
email_address = models.EmailField(max_length=100)
birthdate = models.DateField()
gender = models.CharField(max_length=6, choices=GENDER_CHOICES)
personal_id_number = models.CharField(max_length=100)
passport_number = models.CharField(max_length=100)
personal_photo_link = models.CharField(max_length=100)
id_card_attchment_link = models.CharField(max_length=100)
passport_attachment_link = models.CharField(max_length=100)
street_address = models.CharField(
max_length=100, choices=STREET_ADDRESS_CHOICES)
address_reference_point = models.CharField(max_length=100)
educational_level = models.CharField(
max_length=100, choices=EDUCATIONAL_LEVEL_CHOICES)
specialization = models.CharField(max_length=100)
contact_phone_number = models.CharField(max_length=100)
contact_name = models.CharField(max_length=100)
contact_relationship = models.CharField(
max_length=100, choices=CONTACT_RELATIONSHIP_CHOICES)
medical_condition = models.CharField(
max_length=100, choices=MEDICAL_CONDITION_CHOICES)
medication = models.CharField(max_length=100)
class Meta:
abstract = True
- The models for an app called ez_course:
COURSE_TYPE_CHOICES = [
('Adults', 'Adults'),
('Kids', 'Kids')
]
COURSE_TITLE_CHOICES = [
('General English', 'General English'),
('Big English', 'Big English'),
('Supermind', 'Supermind'),
('Business', 'Business'),
('UK Visa', 'UK Visa'),
('IELTS', 'IELTS'),
]
class CourseDays(models.Model):
date = models.DateField()
class Course(models.Model):
course_type = models.CharField(max_length=100, choices=COURSE_TYPE_CHOICES)
course_title = models.CharField(
max_length=100, choices=COURSE_TITLE_CHOICES)
course_description = models.TextField()
course_start_time = models.TimeField()
course_end_time = models.TimeField()
# teachers
course_cost = models.IntegerField()
course_days = models.ManyToManyField(CourseDays)
- The models for an app called ez_staff:
from ez_core.models import PersonalInfo
from ez_course.models import Course
POSITION_CHOICES = [
('Teacher Assistant', 'Teacher Assistant'),
('Volunteer', 'Volunteer'),
('Teacher', 'Teacher'),
('Service', 'Service'),
('Intern', 'Intern'),
('Admin', 'Admin'),
('Boss', 'Boss'),
]
class Staff(PersonalInfo):
is_married = models.BooleanField(default=False)
number_of_children = models.IntegerField()
start_working_date = models.DateField()
position = models.CharField(max_length=100, choices=POSITION_CHOICES)
taught_courses = models.ManyToManyField(Course, blank=True)
is_active = models.BooleanField(default=True)
inactivity_reason = models.CharField(max_length=100, blank=True, null=True)
- The models for an app called ez_student:
from ez_core.models import PersonalInfo
from ez_course.models import Course
class DailyAttendance(models.Model):
date = models.DateField()
first_hour = models.BooleanField(default=False)
second_hour = models.BooleanField(default=False)
leave = models.BooleanField(default=False)
class Test(models.Model):
test_title = models.CharField(max_length=100)
test_max_score = models.IntegerField()
test_score = models.IntegerField()
test_date = models.DateField()
class Student(PersonalInfo):
has_bus_service = models.BooleanField(default=False)
is_postponed = models.BooleanField(default=False)
postpone_reason = models.CharField(max_length=100, blank=True, null=True)
courses = models.ForeignKey(Course, on_delete=models.CASCADE)
daily_attendance = models.ManyToManyField(
DailyAttendance, blank=True)
tests = models.ManyToManyField(Test)