1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-10 07:37:30 +00:00

Merge branch '114-fix-the-automatic-enum-naming-warning' into 'develop'

Resolve "Fix the automatic enum naming warning"

See merge request 
This commit is contained in:
Bram Wiepjes 2020-08-31 11:42:34 +00:00
commit fff2bd5764
4 changed files with 13 additions and 10 deletions
backend
requirements
src/baserow/contrib/database/api

View file

@ -10,4 +10,4 @@ gunicorn==20.0.4
django-mjml==0.9.0
requests==2.23.0
itsdangerous==1.1.0
drf-spectacular==0.9.8
drf-spectacular==0.9.12

View file

@ -3,6 +3,7 @@ import logging
from rest_framework import serializers
from baserow.api.utils import get_serializer_class
from baserow.api.serializers import get_example_pagination_serializer_class
from baserow.core.utils import model_default_values, dict_to_object
from baserow.contrib.database.fields.registries import field_type_registry
@ -113,3 +114,8 @@ def get_example_row_serializer_class(add_id=False):
get_example_row_serializer_class.cache[class_name] = class_object
return class_object
example_pagination_row_serializer_class = get_example_pagination_serializer_class(
get_example_row_serializer_class(True)
)

View file

@ -12,12 +12,14 @@ from baserow.api.decorators import map_exceptions
from baserow.api.pagination import PageNumberPagination
from baserow.api.errors import ERROR_USER_NOT_IN_GROUP
from baserow.api.schemas import get_error_schema
from baserow.api.serializers import get_example_pagination_serializer_class
from baserow.core.exceptions import UserNotInGroupError
from baserow.contrib.database.api.tables.errors import ERROR_TABLE_DOES_NOT_EXIST
from baserow.contrib.database.table.handler import TableHandler
from baserow.contrib.database.table.exceptions import TableDoesNotExist
from baserow.contrib.database.api.rows.errors import ERROR_ROW_DOES_NOT_EXIST
from baserow.contrib.database.api.rows.serializers import (
example_pagination_row_serializer_class
)
from baserow.contrib.database.rows.handler import RowHandler
from baserow.contrib.database.rows.exceptions import RowDoesNotExist
@ -73,9 +75,7 @@ class RowsView(APIView):
'user has provided and the format of it depends on the fields type.'
),
responses={
200: get_example_pagination_serializer_class(
get_example_row_serializer_class(True)
),
200: example_pagination_row_serializer_class,
400: get_error_schema([
'ERROR_USER_NOT_IN_GROUP',
'ERROR_REQUEST_BODY_VALIDATION'

View file

@ -10,13 +10,12 @@ from baserow.api.decorators import map_exceptions, allowed_includes, validate_bo
from baserow.api.errors import ERROR_USER_NOT_IN_GROUP
from baserow.api.pagination import PageNumberPagination
from baserow.api.schemas import get_error_schema
from baserow.api.serializers import get_example_pagination_serializer_class
from baserow.core.exceptions import UserNotInGroupError
from baserow.contrib.database.api.rows.serializers import (
get_row_serializer_class, RowSerializer
)
from baserow.contrib.database.api.rows.serializers import (
get_example_row_serializer_class
get_example_row_serializer_class, example_pagination_row_serializer_class
)
from baserow.contrib.database.api.views.grid.serializers import GridViewSerializer
from baserow.contrib.database.views.exceptions import (
@ -84,9 +83,7 @@ class GridViewView(APIView):
'the fields type.'
),
responses={
200: get_example_pagination_serializer_class(
get_example_row_serializer_class(True)
),
200: example_pagination_row_serializer_class,
400: get_error_schema(['ERROR_USER_NOT_IN_GROUP']),
404: get_error_schema(['ERROR_GRID_DOES_NOT_EXIST'])
}