Skip to content
Merged
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
30 changes: 28 additions & 2 deletions FusionIIIT/applications/programme_curriculum/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,38 @@ def view_curriculums_of_a_programme(request, programme_id):
'working_curriculums': [
{
**model_to_dict(c),
'batches': [model_to_dict(b) for b in c.batches.all()]
'batches': [
{
'id': b.id,
'name': b.name,
'discipline': b.discipline.acronym,
'year': b.year,
'running_batch': b.running_batch,
# 'total_seats': b.total_seats,
}
for b in c.batches.all()
]
# Add batches for each curriculum
}
for c in working_curriculums
],
'past_curriculums': [model_to_dict(c) for c in past_curriculums],
'past_curriculums': [
{
**model_to_dict(c),
'batches': [
{
'id': b.id,
'name': b.name,
'discipline': b.discipline.acronym, # Use acronym instead of ID
'year': b.year,
'running_batch': b.running_batch,
# 'total_seats': b.total_seats,
}
for b in c.batches.all()
]
}
for c in past_curriculums
],
# 'notifications': [model_to_dict(n) for n in request.user.notifications.all()]
}

Expand Down