Skip to content

Conversation

delinhabit
Copy link
Contributor

This fixes #2711

@lovelydinosaur
Copy link
Member

I wonder if we should handle this in a more generic way - eg in the reverse function...

https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/reverse.py#L18

Wrap the scheme.reverse in a NoReverseMatch block and fallback to the none-versioned approach there?

@delinhabit
Copy link
Contributor Author

Yeah, I think you are right. I'll try do do that.

@delinhabit
Copy link
Contributor Author

Moved the fallback logic to reverse and added tests around the new behavior in test_reverse.py

@lovelydinosaur
Copy link
Member

Excellent!

@lovelydinosaur
Copy link
Member

Stupidly I managed to miss this for the 3.1.1 release - apologies.
Merging now so it'll be in for 3.1.2.

lovelydinosaur added a commit that referenced this pull request Mar 23, 2015
…i-reversal

Handle reversal of non-API view_name in HyperLinkedRelatedField
@lovelydinosaur lovelydinosaur merged commit a90dbe3 into encode:master Mar 23, 2015
@delinhabit delinhabit deleted the namespaced-versioning-non-api-reversal branch April 16, 2015 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't reverse non-API URLs with NamespaceVersioning
2 participants