-
Notifications
You must be signed in to change notification settings - Fork 150
Fix multiple JSON profiles issue in one model #696
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple JSON profiles issue in one model #696
Conversation
@fantix I think we can't make the complexity any less. |
Option 2: iterate every property of a model to find all JSON properties in The main difference is to keep As for author of the project, you are the author contributing MR. If you mean to become a maintainer, I think we don't have a rule or something now, but I believe it can be made by regularly answering questions and fixing issues for some time. |
@wwwjfy thank you for your options and thank you for your work. About your Option 2: I think it is not an optimal solution because About your Option 3: Sorry, If I don't understand you correctly. We can add a separate place or we can add special property inside |
To clarify, with the current implementation, the search is done once, and
I mean when the table is initialized (in Line 286 in c43b619
get_profile we can use that information.
At this moment I lean to option 3. Both should be relatively small changes. I could have a diff to show my idea if that's more clear. |
@wwwjfy thank you, I get your point - save to instance list of
|
I will try to implement a new solution. |
@wwwjfy what do you think about this solution? Codacy said that complexity has increased :( Could you tell me |
No worries, this is fine. :thisisfine: |
At least in major version 1, aliases are not a problem as the JSON properties are the same as "official" columns in the model classes. Same names can't happen. Diff looks fine to me. @fantix please help to take a look too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Please also rebase to the latest master - sorry I think the conflict is caused by my recent fix.
@fantix sorry, are you mean to make master rebase with removing the last merge commit |
1921c02
to
3d94993
Compare
63c6139
to
8e2086a
Compare
Complexity increasing per file
==============================
- src/gino/json_support.py 1
See the complete overview on Codacy |
Thanks for working on this one! |
* fix multiple json profiles * rename __profile__ to __profiles__ * fix test * reformat code * update authors * revert solution * add a new solution * apply suggestions * update json_prop_names to set * optimize set usage Co-authored-by: Fantix King <[email protected]>
Fixed support for several JSON profiles in one model.
Done:
__profile__
to__profiles__
If you have any comments or suggestions, let me know :)