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

add interchangable model keys support #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PetrDlouhy
Copy link
Contributor

@PetrDlouhy PetrDlouhy commented Jul 12, 2022

Add possibility to change target object key field by COMMENTS_ID_OVERRIDES settings, e.g.:

COMMENTS_ID_OVERRIDES = {
    'assets.Asset': 'asset_uuid',
}

I have model with id field as PK and want to use another non-PK uuid field to use for comments (to avoid showing object IDs to users).

This is conceptual draft of the functionality that enables that through one simple mapping in settings.

Please review if this concept makes sens. If yes, I will do following things:

  • Check, that the new settings is used everywhere.
  • Add documentation
  • Add tests

@PetrDlouhy
Copy link
Contributor Author

Nobody has commented this, so I decided to finish the task. I have added documentation and test routines.

Now I think this is ready to be pulled.

@PetrDlouhy PetrDlouhy marked this pull request as ready for review August 2, 2022 13:46
@PetrDlouhy PetrDlouhy force-pushed the interchangable_keys branch from 9d131a2 to 4ba9d30 Compare August 2, 2022 14:03
@blockchainGuru1018
Copy link

it's looks good in my view @PetrDlouhy

@PetrDlouhy
Copy link
Contributor Author

@felixxm Can you please take a look at this PR?

@PetrDlouhy
Copy link
Contributor Author

@claudep @felixxm Could you please tak a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants