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:
    ('Female', 'Female'),
    ('Male', 'Male')

    ('A', 'A'),
    ('B', 'B')

    ('Bachelor\'s Degree', 'Bachelor\'s Degree'),
    ('Master\'s Degree', 'Master\'s Degree'),
    ('PhD Degree', 'PhD Degree'),

    ('Brother', 'Brother'),
    ('Father', 'Father'),
    ('Mother', 'Mother'),
    ('Sister', 'Sister'),
    ('Uncle', 'Uncle'),
    ('Wife', 'Wife'),

    ('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:
    ('Adults', 'Adults'),
    ('Kids', 'Kids')

    ('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

    ('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)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.