Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SchoolInterface/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
'rest_framework',
'corsheaders',
'rest_framework_simplejwt.token_blacklist',
'spoken',
]

MIDDLEWARE = [
Expand Down
1,260 changes: 1,115 additions & 145 deletions accounts/migrations/0001_initial.py

Large diffs are not rendered by default.

This file was deleted.

39 changes: 39 additions & 0 deletions accounts/migrations/0002_auto_20240501_1530.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.2.1 on 2024-05-01 07:44

from django.db import migrations

def populate_classes(apps, schema_editor):
MAX_CLASS = 12
CLASS_CHOICES = [i for i in range(1,MAX_CLASS+1)]
ClassName = apps.get_model('accounts', 'ClassName')
for val in CLASS_CHOICES:
ClassName.objects.create(name=val)

def populate_organisation_type(apps, schema_editor):
ORGANISATION_TYPE = [ 'Central Government', 'State Government', 'Public Company', 'Private Company', 'NGO', 'Foreign' ]
OrganisationType = apps.get_model('accounts', 'OrganisationType')
for type in ORGANISATION_TYPE:
OrganisationType.objects.create(name=type)

def populate_school_type(apps, schema_editor):
SCHOOL_TYPE = [ 'Central Government Funded', 'State Government Funded',
'Public Company Funded', 'Private Company Funded', 'NGO Funded', 'Foreign Funded', 'Self-Funded']
SchoolType = apps.get_model('accounts', 'SchoolType')
for type in SCHOOL_TYPE:
SchoolType.objects.create(name=type)

def populated_context(apps, schema_editor):
CONTEXTS = [
'organisation', 'state', 'district', 'city', 'school', 'class', 'section'
]
Context = apps.get_model('accounts', 'Context')
for val in CONTEXTS:
Context.objects.create(name = val)

class Migration(migrations.Migration):
dependencies = [
("accounts", "0001_initial"),
]

operations = [migrations.RunPython(populate_classes), migrations.RunPython(populate_organisation_type),
migrations.RunPython(populate_school_type)]
59 changes: 59 additions & 0 deletions accounts/migrations/0003_auto_20240501_1530.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Generated by Django 4.2.1 on 2024-05-01 10:00

from django.db import migrations

def populate_permissions(apps, schema_editor):
PERMISSIONS = [
#Training - Students
('can add student training', 'can_add_student_training'),
('can edit student training', 'can_edit_student_training'),
('can view student training', 'can_view_student_training'),
('can delete student training', 'can_delete_student_training'),
('can approve student training', 'can_approve_student_training'),

#Test - Students
('can add student test', 'can_add_student_test'),
('can edit student test', 'can_edit_student_test'),
('can view student test', 'can_view_student_test'),
('can delete student test', 'can_delete_student_test'),
('can approve student test', 'can_approve_student_test'),

#Role Assignment
('can assign role', 'can_assign_role'),

#Reports
('can view organization report', 'can_view_organization_report'),
('can view state report', 'can_view_state_report'),
('can view district report', 'can_view_district_report'),
('can view city report', 'can_view_city_report'),
('can view school report', 'can_view_school_report'),

#Bulk School Registration
('allow bulk school registration', 'allow_bulk_school_registration'),

#Training - Teachers
('can add teacher training', 'can_add_teacher_training'),
('can edit teacher training', 'can_edit_teacher_training'),
('can view teacher training', 'can_view_teacher_training'),
('can delete teacher training', 'can_delete_teacher_training'),
('can approve teacher training', 'can_approve_teacher_training'),

#Test - Teachers
('can add teacher test', 'can_add_teacher_test'),
('can edit teacher test', 'can_edit_teacher_test'),
('can view teacher test', 'can_view_teacher_test'),
('can delete teacher test', 'can_delete_teacher_test'),
('can approve teacher test', 'can_approve_teacher_test'),

]
Permission = apps.get_model('accounts', 'Permission')
for name, codename in PERMISSIONS:
Permission.objects.create(name=name, codename=codename)


class Migration(migrations.Migration):
dependencies = [
("accounts", "0002_auto_20240501_1530"),
]

operations = [migrations.RunPython(populate_permissions)]
48 changes: 0 additions & 48 deletions accounts/migrations/0003_messagetype_message_condition.py

This file was deleted.

This file was deleted.

Loading