Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
Custom primary key serialization.#2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
6e74d35 toe8bca56Comparexordoquy commentedJun 9, 2015
I'm a bit confused about this PR against#2788 |
ovangle commentedJun 11, 2015
This PR has little to do with#2788#3000. Currently, the code in question assumes that the primary key's value is a primitive and passes it on to the json/xml/etc serializer to serialize. In the case of UUID's, this just calls This may not be the desired behaviour, so I've changed the foreign key field to accept an optional subfield, which can be used to customise the output representation of the foreign key's value. But it can be used to customise the output serialization of primary keys in general. ps. the implementation of this should have been independent to the implementation of#2788, but the unit tests rely on being able to serialise a UUID to a format other than the verbose hex format. |
Adds a 'pk_field' parameter which can be used to proxy serialization anddeserialization of arbitrary primary key values.
e8bca56 toa1e0baeCompareovangle commentedJun 14, 2015
Rebased to use implementation from#3000. |
xordoquy commentedJun 15, 2015
This looks good to me. Thanks for the work. |
Support custom serialization options for
PrimaryKeyRelatedFields.