Fix wrong href's in results from collection viewsets #254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The pulp_ansible viewsets build hrefs by reverse() on the
pulp_ansible url name. But the galaxy_ng names are different
and include url namespaces ('galaxy:api:v3:collection' for ex).
Makes collection api endpoints serialize correctly, with the various
href's pointing to the right places. That includes:
endpoints
Update the collection url 'names' so that suffix matches the
upstream pulp names exactly (sanes url namespace)
Add custom collection Serializer's that uses view_namespace for url reverse.
Add a serializers.collections.HrefNamespaceMixin to use
with the galaxy_ng subclasses of collection related
pulp_ansible.app.galaxy Serializers.
Update the collection related viewsets to use the new
viewsets.
Add a ViewNamespaceSerializerContextMixin to mixin
with the collection viewset. This provides a
get_serializer_context that adds 'view_namespace'
and 'view_route' info to the context, so the various
href serializer methods will generate the correct urls.
Issue: #247