art049 / art049/odmantic

Behavior with aliases

Open
#38 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
1.2k
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Hello, I'm thinking to enable the aliases on the fields. It would enable a cleaner attribute validation to avoid conflicts between builtin methods and the fields for example (as already done by Pydantic).

The current behavior I'm thinking of:
- If a field has an `alias` and no `key_name`, the resulting document key will be the alias
- It's still possible to customize the key_name with an alias already set by specifying the `key_name` kwarg

Do you think some more customization/options would be useful ?

Contributor guide

Open the contributing guide

Research direction

No file or test is identified; start by locating the model field alias and key_name handling and reviewing how fields become MongoDB document keys. Done would require a decided alias/key_name behavior, documented edge cases around builtin-name conflicts, and tests covering the selected rules.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.