@@ -11,6 +11,7 @@ django-restframework = "*"
djangorestframework-bulk = "*"
mysql = "*"
mysqlclient = "*"
+django-filter = "*"
[requires]
python_version = "3.7"
@@ -119,3 +119,9 @@ USE_TZ = True
# https://docs.djangoproject.com/en/3.0/howto/static-files/
STATIC_URL = '/static/'
+
+REST_FRAMEWORK = {
+ 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
+ 'PAGE_SIZE': 3,
+ 'DEFAULT_FILTER_BACKENDS': ['django_filters.rest_framework.DjangoFilterBackend'],
+}
@@ -25,3 +25,4 @@ class DailyReportViews(APIView):
class ReportViews(ModelViewSet):
queryset = DailyReport.objects.all()
serializer_class = DailyReportSerializer
+ filter_fields = {'title': ['exact']}