django / django-contrib-comments

BSD 3-Clause "New" or "Revised" License
614 stars 196 forks source link

add interchangable model keys support #188

Open PetrDlouhy opened 2 years ago

PetrDlouhy commented 2 years ago

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:

PetrDlouhy commented 2 years ago

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.

blockchainGuru1018 commented 1 year ago

it's looks good in my view @PetrDlouhy

PetrDlouhy commented 1 year ago

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

PetrDlouhy commented 8 months ago

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