Skip to content

[ADD] jsonifier: with_fieldname option - #2668

Merged
OCA-git-bot merged 4 commits into
OCA:14.0from
gfcapalbo:14.0-jsonifier-with-name-OCA-VERSION
Nov 6, 2023
Merged

[ADD] jsonifier: with_fieldname option#2668
OCA-git-bot merged 4 commits into
OCA:14.0from
gfcapalbo:14.0-jsonifier-with-name-OCA-VERSION

Conversation

@gfcapalbo

@gfcapalbo gfcapalbo commented Jun 30, 2023

Copy link
Copy Markdown
Contributor

Jsonifier adds an extra key called fieldname_$field with field name on the same level of the $field key.
Does not disrupt, function feature or specialized resolvers.

@gfcapalbo
gfcapalbo force-pushed the 14.0-jsonifier-with-name-OCA-VERSION branch from 15c38c7 to f7fc9f5 Compare June 30, 2023 13:35
Comment thread jsonifier/models/models.py Outdated
Comment thread jsonifier/models/models.py Outdated
Comment thread jsonifier/models/models.py Outdated
@gfcapalbo

Copy link
Copy Markdown
Contributor Author

Failing for reduced coverage, will add tests-

@gfcapalbo
gfcapalbo force-pushed the 14.0-jsonifier-with-name-OCA-VERSION branch from f7fc9f5 to 952deac Compare September 19, 2023 15:59
@gfcapalbo gfcapalbo changed the title [ADD] incorporate with_fieldname in new Jsonifier WIP: [ADD] default_function parameter in jsonifier Sep 20, 2023
@gfcapalbo

Copy link
Copy Markdown
Contributor Author

WIP. small fixes and tests needed.

Comment thread jsonifier/README.rst Outdated
Comment thread jsonifier/README.rst Outdated
Comment thread jsonifier/models/models.py Outdated
Comment thread jsonifier/models/models.py Outdated
Comment thread jsonifier/README.rst Outdated
@gfcapalbo
gfcapalbo force-pushed the 14.0-jsonifier-with-name-OCA-VERSION branch 7 times, most recently from f84cbae to ab799f4 Compare September 20, 2023 15:54
@gfcapalbo
gfcapalbo force-pushed the 14.0-jsonifier-with-name-OCA-VERSION branch from ab799f4 to ce10761 Compare September 20, 2023 15:56
@gfcapalbo gfcapalbo changed the title WIP: [ADD] default_function parameter in jsonifier WIP: [ADD] With_fieldname parameter in jsonifier Sep 20, 2023
@gfcapalbo

Copy link
Copy Markdown
Contributor Author

@thomaspaulb complete with passing tests. Removing WIP.
the new structure will not make the old code fail, because it does not change the value fetched, but adds on same level a new key. I had an idea to override function feature of jsonifier, but that is not needed anymore.
.
(see test data and usage.rst)

As a possible jsonifier addition the feature "default_function" could be implemented in a separate MR, unrelated to this

All explanations and examples moved to usage.rst

@gfcapalbo gfcapalbo changed the title WIP: [ADD] With_fieldname parameter in jsonifier [ADD] With_fieldname parameter in jsonifier Sep 20, 2023
Comment thread jsonifier/readme/USAGE.rst Outdated
Comment thread jsonifier/readme/USAGE.rst Outdated
Comment thread jsonifier/readme/USAGE.rst Outdated
Comment thread jsonifier/models/models.py Outdated
@thomaspaulb

Copy link
Copy Markdown
Contributor

I like the refactor to using a sister key, it's less intrusive.

Comment thread jsonifier/models/models.py Outdated
Comment thread jsonifier/models/models.py Outdated
@OCA-git-bot

Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@thomaspaulb

Copy link
Copy Markdown
Contributor

/ocabot merge minor

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 14.0-ocabot-merge-pr-2668-by-thomaspaulb-bump-minor, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 2bf088b into OCA:14.0 Nov 6, 2023
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 9f5af43. Thanks a lot for contributing to OCA. ❤️

@simahawk

Copy link
Copy Markdown
Contributor

I'm forward porting from 14 to 16... it's a bit painful as commit were not squashed here. Next time, please, do it if the feature is just one at the end 😉
Danke! 🙏

@simahawk simahawk changed the title [ADD] With_fieldname parameter in jsonifier [ADD] jsonifier: with_fieldname option Feb 21, 2025
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.

5 participants