Skip to content

Commit

Permalink
added apis for app
Browse files Browse the repository at this point in the history
  • Loading branch information
Daksh119 committed May 5, 2024
1 parent 4dc7f39 commit a7567d0
Show file tree
Hide file tree
Showing 4 changed files with 646 additions and 1 deletion.
89 changes: 89 additions & 0 deletions FusionIIIT/applications/online_cms/api/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# from rest_framework.authtoken.models import Token
# from rest_framework import serializers

# from applications.academic_procedures.models import course_registration


from rest_framework import serializers
from applications.academic_information.models import (Student,Student_attendance,Calendar, Timetable)
from applications.programme_curriculum.models import Course as Courses
from applications.programme_curriculum.models import CourseInstructor
from applications.academic_procedures.models import course_registration
from applications.globals.models import ExtraInfo
from applications.online_cms.models import *

class ExtraInfoSerializer(serializers.ModelSerializer):
class Meta:
model = ExtraInfo
fields = '__all__' # Include all fields

class StudentSerializer(serializers.ModelSerializer):
class Meta:
model = Student
fields = '__all__'

class CourseInstructorSerializer(serializers.ModelSerializer):
class Meta:
model = CourseInstructor
fields = '__all__'

class CoursesSerializer(serializers.ModelSerializer):
class Meta:
model = Courses
fields = '__all__'

def create(self,validated_data):
return Courses.objects.create(**validated_data)
class RegisteredCoursesSerializer(serializers.ModelSerializer):

class Meta:
model = course_registration
fields = ('__all__')
class CourseRegistrationSerializer(serializers.ModelSerializer):
class Meta:
model = Courses
fields = ('__all__')

class ModulesSerializer(serializers.ModelSerializer):
class Meta:
model = Modules
fields = '__all__'

class CourseDocumentsSerializer(serializers.ModelSerializer):
class Meta:
model = CourseDocuments
fields = '__all__'

class AssignmentSerializer(serializers.ModelSerializer):
class Meta:
model = Assignment
fields = '__all__' # Include all fields for now (adjust as needed)

class AttendanceSerializer(serializers.ModelSerializer):
class Meta:
model = Attendance
fields = '__all__' # Include all fields for now (adjust as needed)

class ForumSerializer(serializers.ModelSerializer):
class Meta:
model = Forum
fields = '__all__' # Include all fields for now (adjust as needed)

class ForumReplySerializer(serializers.ModelSerializer):
class Meta:
model = ForumReply
fields = '__all__' # Include all fields for now (adjust as needed)

class GradingSchemeSerializer(serializers.ModelSerializer):
class Meta:
model = GradingScheme
fields = '__all__' # Include all fields for now (adjust as needed)

class GradingScheme_gradesSerializer(serializers.ModelSerializer):
class Meta:
model = GradingScheme_grades
fields = '__all__' # Include all fields for now (adjust as needed)
class TopicsSerializer(serializers.ModelSerializer):
class Meta:
model = Topics,
fields = '__all__'
15 changes: 15 additions & 0 deletions FusionIIIT/applications/online_cms/api/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# from django.conf.urls import url

# from . import views

# urlpatterns = [
# url(r'^courses', views.viewcourses_serialized, name="registered_courses")
# ]
from django.conf.urls import url
# from .views import course
from . import views
urlpatterns = [
# url(r'^courses', CourseListView.as_view(), name='courses'),
url(r'^(?P<course_code>[A-Za-z0-9]+)/(?P<version>[\d.]+)/$', views.course, name='course'),
url(r'^courses', views.courseview, name='courseview'),
]
Loading

0 comments on commit a7567d0

Please sign in to comment.