MongoEngine / MongoEngine/mongoengine

Add possibility to have read-only model instances without data descriptors for fields

Open
#1,009 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Performance
Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

I am suggesting somehow to add possibility to be able during a query to instruct the mapper to bring back light model instances which are read-only and thus don't need data descriptor stuff to track instance changes.

Otherwise this descriptors are quite heavy: http://stackoverflow.com/questions/30342212/override-attribute-access-precedence-having-a-data-descriptor

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the mapper's query path and how model instances receive data descriptors. The issue provides no file or test entry point, so first locate the relevant query and model construction code. Done would mean a query can request lightweight, read-only model instances without descriptor overhead, with behavior covered by tests.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.