Skip to content
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

Feature/allow renaming expandable foreign keys #42

Merged
merged 1 commit into from
Jun 9, 2020

Conversation

dshafer
Copy link
Collaborator

@dshafer dshafer commented Jun 8, 2020

Ran into an issue where I wanted the name of an expandable field to be different than the name of the field on the underlying model

Fixes #41

@dshafer dshafer requested review from bgrant and demianbrecht June 8, 2020 22:53
@dshafer dshafer force-pushed the feature/allow-renaming-expandable-foreign-keys branch from 4c3942e to 652fc76 Compare June 8, 2020 23:47
demianbrecht
demianbrecht previously approved these changes Jun 8, 2020
inst_field_name = field_type.inst_field_name or field_name
val = getattr(inst, inst_field_name)
else:
val = _get_unexpanded_field_value(inst, field_name, field_type)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need the same inst_field_name treatment because it's not actually hitting the model, right?

Copy link
Collaborator Author

@dshafer dshafer Jun 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does need it, and accesses it within the called function as field_type.inst_field_name (line 46)

@dshafer dshafer force-pushed the feature/allow-renaming-expandable-foreign-keys branch from 652fc76 to 2eec430 Compare June 9, 2020 00:28
@dshafer dshafer merged commit 6c1f88c into master Jun 9, 2020
@dshafer dshafer deleted the feature/allow-renaming-expandable-foreign-keys branch June 9, 2020 05:24
@salesforce-cla
Copy link

salesforce-cla bot commented Dec 9, 2020

Thanks for the contribution! It looks like @dshafer is an internal user so signing the CLA is not required. However, we need to confirm this.

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.

Cannot change the name of expandable fields
2 participants