MongoEngine / mongoengine

A Python Object-Document-Mapper for working with MongoDB
http://mongoengine.org
MIT License
4.23k stars 1.23k forks source link

Make reference fields a proxy to allow access to field.id without dereferencing #298

Open rozza opened 11 years ago

rozza commented 11 years ago

When looking at any other value then trigger a dereference either directly or on the list.

refs: #61

thedug commented 10 years ago

Has anybody started this?

rozza commented 10 years ago

I havent started 0.9 development yet

Fraggle commented 10 years ago

Just to let you know, I'm interested in this feature as well.

lwcolton commented 9 years ago

+1 for this

thedug commented 9 years ago

Is 0.9 still in the works or is mongoengine stalled?

bsherry commented 9 years ago

+1 This would be a great addition for things like uniqueness checks in a list of referenceField's

bond777 commented 9 years ago

+1

MRigal commented 9 years ago

Definitely a good optimization to have ! But I would rather release a 0.9 now and postpone this to a new release

MRigal commented 9 years ago

And it might be a good idea to have #490 in mind while implementing the concept for this issue

smcclstocks commented 9 years ago

Are we able to access a referencefield to obtain the ID & avoid the dereference overhead yet? Thanks.

+1

computmaxer commented 9 years ago

+1

codekiln commented 8 years ago

+1

pchristos commented 7 years ago

+1

wojcikstefan commented 7 years ago

We've implemented this (among many other things) in my company's fork of this package (https://github.com/closeio/mongoengine#mongomallard). I'll try to move the performance improvements (including this one) over to this package.

PS GitHub has added reactions to their UI now (https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments) so that we don't need to create "+1" comments.

mclate commented 7 years ago

This is very needed update. Is there any progress on this one? (Also wonder if it would be possible to check whether field is a reference proxy like it was possible to check via isinstance(field, DBRef)?)

djrochford commented 5 years ago

+1