Merge pull request #562 from mjtamlyn/view-name

Support URL namespaces.
This commit is contained in:
Tom Christie 2013-01-07 06:55:33 -08:00
commit 47f0d17f4d

View File

@ -403,7 +403,7 @@ class HyperlinkedRelatedField(RelatedField):
except: except:
raise ValidationError(self.error_messages['no_match']) raise ValidationError(self.error_messages['no_match'])
if match.url_name != self.view_name: if match.view_name != self.view_name:
raise ValidationError(self.error_messages['incorrect_match']) raise ValidationError(self.error_messages['incorrect_match'])
pk = match.kwargs.get(self.pk_url_kwarg, None) pk = match.kwargs.get(self.pk_url_kwarg, None)