Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
xordoquy merged 1 commit intoencode:masterfromovangle:primary_key_serialization
Jun 15, 2015

Conversation

@ovangle
Copy link
Contributor

Support custom serialization options forPrimaryKeyRelatedFields.

@ovangleovangleforce-pushed theprimary_key_serialization branch 3 times, most recently from6e74d35 toe8bca56CompareApril 2, 2015 05:08
@xordoquy
Copy link
Contributor

I'm a bit confused about this PR against#2788

@ovangle
Copy link
ContributorAuthor

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 callsstr on the result, writing a 'verbose hex' format UUID in the serialized representation.

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.
@ovangleovangleforce-pushed theprimary_key_serialization branch frome8bca56 toa1e0baeCompareJune 14, 2015 18:55
@ovangle
Copy link
ContributorAuthor

Rebased to use implementation from#3000.

@xordoquyxordoquy added this to the3.1.4 Release milestoneJun 15, 2015
@xordoquy
Copy link
Contributor

This looks good to me. Thanks for the work.
I wonder how helpful this will be for NoSQL databases.

xordoquy added a commit that referenced this pull requestJun 15, 2015
@xordoquyxordoquy merged commit49404f6 intoencode:masterJun 15, 2015
@xordoquyxordoquy changed the titlePrimary key serializationCustom primary key serialization.Jun 15, 2015
@lovelydinosaurlovelydinosaur modified the milestones:3.1.4 Release,3.2.0 ReleaseJul 30, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

3.2.0 Release

Development

Successfully merging this pull request may close these issues.

4 participants

@ovangle@xordoquy@jpadilla@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp