1👍
I don’t think there’s a good way to do this.
The fields selected are limited at query time to the fields in the model:
https://github.com/django-nonrel/mongodb-engine/blob/master/django_mongodb_engine/compiler.py#L123
https://github.com/django/django/blob/master/django/db/models/sql/query.py#L1638
Can you use a dict field/embedded object and have some kind of document level namespace to grab these from?
👤gone
1👍
If there’s a way to do this using a SQL database and it doesn’t work with MongoDB Engine, please open a bug report. Otherwise I’m afraid you need to get this feature into Django first 🙂
- [Answered ]-Django modelform validation get field from db if not if form
- [Answered ]-Reload template after AJAX POST request in Django
- [Answered ]-Initial data as queryset for formset foreign key field
- [Answered ]-Django register
- [Answered ]-Django: syntax of return HttpResponseRedirect
Source:stackexchange.com