Skip to content

mongoengine.Document.objects is not callable #75

@Coldwings

Description

@Coldwings

In the fake module mongoengine, the fake Document class is defined as

from mongoengine.errors import DoesNotExist, MultipleObjectsReturned

class Document(object):
    _meta = None
    objects = None

    id = None
    pk = None

    MultipleObjectsReturned = MultipleObjectsReturned
    DoesNotExist = DoesNotExist

    save = lambda: None

which member objects gives a None. The fact in mongoengine it should be a mongoengine.QuerySetManager, which is callable, and can be used as query method.

For now, the code
SomeDocument.objects(query)
pylint gives out a E1102. That should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions