Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upMongoengine compatibility #32
Comments
This comment has been minimized.
This comment has been minimized.
TennyZhuang
commented
Aug 26, 2016
|
+1 |
This comment has been minimized.
This comment has been minimized.
TennyZhuang
commented
Aug 26, 2016
|
is there a reasonable way to resolve this now? |
This comment has been minimized.
This comment has been minimized.
The documentation for
You can try that, but I don't know if it will actually work in your case. |
This comment has been minimized.
This comment has been minimized.
|
BurntSushi makes a good point. I'm withdrawing this request. |
kengruven commentedFeb 24, 2015
I'm trying to run pdoc on a program, and for the most part, it works well, except on one module that has mongoengine.Document subclasses.
mongoengine.Document has a class method "objects" so that if you have a class Foo(mongoengine.Document), then Foo.objects is a special "query set" object which can return all objects, or a filtered subset of them (based on subsequent chained methods).
Unfortunately, this doesn't seem to play nice with pdoc, which uses inspect.getmembers() to inspect the class. A simple example:
Result: this raises mongoengine.connection.ConnectionError: "You have not defined a default connection". Running pdoc on this causes the same exception, but with a deeper stack trace.
The pdoc documentation says "If the name is defined in a different module, it is not public", and since the class method "Document.objects" is defined in the mongoengine module, I would expect it not to be part of the "public interface", and thus not be documented by pdoc. But perhaps I'm misunderstanding.
At least, I'd like to be able to declare a custom blacklist so that it can know to avoid calling getattr(cls, 'objects') on any Document subclasses.