tortoise / tortoise/tortoise-orm
M2M Field Alternative PK
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 516
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 9
Description
Is your feature request related to a problem? Please describe.
I would like to be able to specify an alternative field to be used as the PK in a M2M relation.
Describe the solution you'd like
When declaring a M2M field I would like to optionally set alternative_pk='other_id'
Describe alternatives you've considered
Secondary PKs?
Additional context
Might be bad design, but I'm read only here and it would be nice to have.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by tracing how many-to-many fields are declared and how their primary keys are resolved; done would mean an optional alternative_pk such as other_id is supported for the relation, with coverage for the resulting behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100