コード例 #1
0
 def get_serializer_class(self):
     if self.request.GET.get('mini', 'false').lower() == 'true':
         return MiniCountrySerializer
     if is_tableau(self.request) is True:
         return CountryTableauSerializer
     if self.action == 'list':
         return CountryGeoSerializer
     return CountryRelationSerializer
コード例 #2
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return ListFieldReportTableauSerializer
     if self.action == 'list':
         request_format_type = self.request.GET.get('format', 'json')
         if request_format_type == 'csv':
             return ListFieldReportCsvSerializer
         else:
             return ListFieldReportSerializer
     else:
         return DetailFieldReportSerializer
コード例 #3
0
 def get_serializer_class(self):
     if self.action == 'mini_events':
         return ListMiniEventSerializer
     elif self.action == 'list':
         request_format_type = self.request.GET.get('format', 'json')
         if request_format_type == 'csv':
             return ListEventCsvSerializer
         elif is_tableau(self.request) is True:
             return ListEventTableauSerializer
         else:
             return ListEventSerializer
     else:
         return DetailEventSerializer
コード例 #4
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return AppealDocumentTableauSerializer
     return AppealDocumentSerializer
コード例 #5
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return AppealHistoryTableauSerializer
         # return AppealTableauSerializer
     return AppealHistorySerializer
コード例 #6
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return SituationReportTableauSerializer
     return SituationReportSerializer
コード例 #7
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return CountrySnippetTableauSerializer
     return CountrySnippetSerializer
コード例 #8
0
 def get_serializer_class(self):
     if is_tableau(self.request) is True:
         return PartnerDeploymentTableauSerializer
     return PartnerDeploymentSerializer