Exemple #1
0
 def get_list_object(self, request: HttpRequest):
     params = []
     params: ParamsObject = self.convert_params(request, HttpMethodType.get,
                                                params)
     semester_service: semesterService = semesterService()
     data = semester_service.get_list_object(params)
     return self.send_response(data)
Exemple #2
0
 def get_list_object_page(self, request: HttpRequest):
     params = [{
         "SemesterName":
         RequestConfig(from_session=False,
                       nullable=True,
                       datatype=DataTypes.STRING,
                       default='')
     }, {
         "SemesterCode":
         RequestConfig(from_session=False,
                       nullable=True,
                       datatype=DataTypes.STRING,
                       default='')
     }, {
         "pageNum":
         RequestConfig(from_session=False,
                       nullable=True,
                       datatype=DataTypes.INT,
                       default=0)
     }, {
         "pageSize":
         RequestConfig(from_session=False,
                       nullable=True,
                       datatype=DataTypes.INT,
                       default=10)
     }]
     params: ParamsObject = self.convert_params(request, HttpMethodType.get,
                                                params)
     semester_service: semesterService = semesterService()
     data = semester_service.get_list_object_paginated(params)
     return self.send_response(data)
Exemple #3
0
    def delete(self, request: HttpRequest):
        semester_json = json.loads(request.POST.get("semester_json"))

        semester_object: semesterModel = semesterModel()
        semester_object.semesterid = semester_json.get("semesterid")

        semester_service: semesterService = semesterService()
        semester_object = semester_service.delete(semester_object)

        return self.send_response(semester_object)
Exemple #4
0
 def get(self, request: HttpRequest):
     params = [{
         "id":
         RequestConfig(from_session=False,
                       nullable=False,
                       datatype=DataTypes.INT)
     }]
     params: ParamsObject = self.convert_params(request, HttpMethodType.get,
                                                params)
     semester_service: semesterService = semesterService()
     data = semester_service.get(params)
     return self.send_response(data)