{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3106","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3106/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3106/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3106/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3106","id":92749641,"number":3106,"title":"Make URL_FIELD_NAME setting customizable at the Serializer level","user":{"login":"erikcw","id":113129,"avatar_url":"https://avatars.githubusercontent.com/u/113129?v=3","gravatar_id":"","url":"https://api.github.com/users/erikcw","html_url":"https://github.com/erikcw","followers_url":"https://api.github.com/users/erikcw/followers","following_url":"https://api.github.com/users/erikcw/following{/other_user}","gists_url":"https://api.github.com/users/erikcw/gists{/gist_id}","starred_url":"https://api.github.com/users/erikcw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikcw/subscriptions","organizations_url":"https://api.github.com/users/erikcw/orgs","repos_url":"https://api.github.com/users/erikcw/repos","events_url":"https://api.github.com/users/erikcw/events{/privacy}","received_events_url":"https://api.github.com/users/erikcw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/labels/Enhancement","name":"Enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-02T22:34:25Z","updated_at":"2015-07-02T22:57:05Z","closed_at":null,"body":"There are situations where being able to control the `URL_FIELD_NAME` setting at the Serializer level is desirable.\r\n\r\nFor example, I maintain a project with 2 APIs.  \r\n\r\n1) is a legacy tastypie API that has been migrated to DRF, but must use the same Serialization format as tastypie so that clients aren't broken.\r\n2) an internal \"admin\" API that uses that standard DRF style.\r\n\r\nThe legacy API needs the URL field to be called `resource_uri`.  However, since it is a global setting, I have to use it with my \"admin\" API as well.  It also prevents me from releasing a future version of the the API (ie v2) that uses a different URL_FIELD_NAME.\r\n\r\nMost of the other settings have fine-grained customizability.  This one shouldn't be any different.\r\n\r\n\r\nHere is the transcript from `#restframework`:\r\n\r\n```irc\r\n[9:45am] erikcw: Is it possible to override settings.URL_FIELD_NAME on a per view/serializer basis?\r\n[3:10pm] linovia: erikcw: what is this setting for ?\r\n[3:11pm] erikcw: linovia: It changes the Serializer.url field name to something else — ie Serializer.my_url…\r\n[3:13pm] linovia: erikcw: looking at the sources, it doesn't look like you can do that\r\n[3:14pm] erikcw: Any idea if a pull request would be accepted for this?\r\n[3:16pm] linovia: erikcw: dunno. It looks like it would make the hyperlinked serializers inconsistent\r\n[3:17pm] erikcw: linovia: You mean if you were mixing them in a single project?\r\n[3:17pm] linovia: erikcw: if that wasn't the case, you wouldn't need a per view setting\r\n[3:18pm] erikcw: My use case is that I have 2 APIs in a django project.  A legacy tastypie API that has been migrated to DRF (and hence uses the setting to turn “url” into “resource_uri”).  I also have an “admin” API that sticks to the standard DRF style\r\n[3:19pm] erikcw: Besides, we already allow tweaks of the lookup_field for instance...\r\n[3:20pm] linovia: erikcw: then I think the way to go would be to bring that to an issue so we can discuss it further before putting work in it\r\n[3:20pm] erikcw: linovia: ok\r\n```"},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/118188218","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3106#issuecomment-118188218","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3106","id":118188218,"user":{"login":"xordoquy","id":2340654,"avatar_url":"https://avatars.githubusercontent.com/u/2340654?v=3","gravatar_id":"","url":"https://api.github.com/users/xordoquy","html_url":"https://github.com/xordoquy","followers_url":"https://api.github.com/users/xordoquy/followers","following_url":"https://api.github.com/users/xordoquy/following{/other_user}","gists_url":"https://api.github.com/users/xordoquy/gists{/gist_id}","starred_url":"https://api.github.com/users/xordoquy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xordoquy/subscriptions","organizations_url":"https://api.github.com/users/xordoquy/orgs","repos_url":"https://api.github.com/users/xordoquy/repos","events_url":"https://api.github.com/users/xordoquy/events{/privacy}","received_events_url":"https://api.github.com/users/xordoquy/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T22:57:05Z","updated_at":"2015-07-02T22:57:05Z","body":"You already convinced me on IRC so I'm for this new feature.\r\nWaiting for other's feeling about it."}}