add a new read-only view for /api/v2/credential_types/N/credentials/

This commit is contained in:
Ryan Petrello
2017-05-08 17:11:09 -04:00
parent 4cae50f2ab
commit 2feb7d5a69
3 changed files with 20 additions and 0 deletions

View File

@@ -1511,6 +1511,16 @@ class CredentialTypeDetail(RetrieveUpdateDestroyAPIView):
return super(CredentialTypeDetail, self).destroy(request, *args, **kwargs)
class CredentialTypeCredentialList(SubListAPIView):
model = Credential
parent_model = CredentialType
relationship = 'credentials'
serializer_class = CredentialSerializer
new_in_320 = True
new_in_api_v2 = True
class CredentialList(ListCreateAPIView):
model = Credential