How can I fix the Undefined variable from import: objects in Aptana pydev django mongo-engine?

Aptana 3 (pydev), django 1.3 + mongo-engine0.5.2 My pythonpath is current, the interpreter also works well. But when I try to create a Document object:

class IdCount(Document):
    model_name = StringField(max_length = 30)

When I use "IdCount.objects", it will not work and will show me "Undefined variable from import: objects". But "." can show other variables and classes such as pk (), save (), model_name, etc. By the way, when I use command line mode (django-> shell), it works well. How can I fix this error? Changing the editor parameter may ignore this error, but I want to solve it.

+5
source share
1 answer

Have you tried adding "mongoengine" to Forced Builtins? (Property> PyDev - interpreter / grammar> Configuring the interpreter> Forced built-in functions)

+3
source

All Articles