Skip to content

Document compound queries #96

Description

@brianjgeiger

If I have two items in a collection, one with a category of 'folder' and the other with a category of 'dashboard', I use a find_one query such as

print "What happens with an exclusive and without the overriding"
no_folder = Folder.find_one(Q('category', 'eq', 'folder') and Q('category', 'eq', 'dashboard'))
print no_folder.name

and instead of finding no items (as I would expect), I get the Dashboard item. If I were to switch the search terms,

print "What happens with an exclusive and without the overriding"
no_folder = Folder.find_one(Q('category', 'eq', 'dashboard') and Q('category', 'eq', 'folder'))
print no_folder.name

I get the folder item.

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