问题
I have a queryset like this in python.
notes = Note.objects[:10]
if i do len(notes) it gives me 10 which is correct. But when i pass "notes" object to template and try
{{notes|length}}
then i get 16 (which is total count of note data). Even if i do Note.objects.limit(5)
it's the same. Is this a bug in MongoEngine? or am i doing something wrong?
回答1:
This was a bug in MongoEngine. Issue about this can be found on; https://github.com/hmarr/mongoengine/issues/166
来源:https://stackoverflow.com/questions/5990026/mongoengine-slicing-queryset-mongodb-with-django