AC-1040 Add 'type' attribute as serializer field, add 'types' attribute to options response.

This commit is contained in:
Chris Church
2014-03-10 17:29:09 -04:00
parent e957de2016
commit b631f24e5b
2 changed files with 23 additions and 12 deletions

View File

@@ -181,6 +181,7 @@ class GenericAPIView(generics.GenericAPIView, APIView):
# appropriate metadata about the fields that should be supplied.
serializer = self.get_serializer()
actions['GET'] = serializer.metadata()
ret['types'] = [serializer.get_type(None)] # FIXME: Support multiple types?
if actions:
ret['actions'] = actions
if getattr(self, 'search_fields', None):