Access super().objects

Skip to first unread message

Stephane Rainville

Feb 20, 2021, 1:23:25 AM2/20/21
to MongoEngine Users
I have a defined a new document class

class MyNewDoc(Document):
    meta = {"abstract": True,}

I'm trying to intercept the calls to "objects" to inject query parameters into the query as if it was a middleware.

    def objects(cls, **kwargs):
      # manipulate kwargs here
     return super().objects       # super has no attribute objects

No sucess

My other idea is to instantiate a QuerySetmanager and call filter but so far no sucess.

Any hints?

Priyansh Singh

Feb 20, 2021, 1:33:08 AM2/20/21
Yeah using query set manager is correct way to go

You received this message because you are subscribed to the Google Groups "MongoEngine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages