Skip to content

Conversation

@polyrabbit
Copy link
Contributor

Say we have a string field called from_, and we use Q(from___contains='blah') to query against it. However mongoengine seems to interpret this query incorrectly as it use __ to split field and operator, which leads to from and _contains which is certainly incorrect. I believe we should use rsplit to split field and operator since operators are always in the right hand side.

@yograterol yograterol added the bug label Jun 25, 2014
@yograterol yograterol added this to the 0.9 milestone Jun 25, 2014
@yograterol
Copy link
Contributor

Well, it's good solution. 👍

yograterol added a commit that referenced this pull request Jun 25, 2014
Fixed incorrectly split a query key, when it ends with "_"
@yograterol yograterol merged commit 6f7ad7e into MongoEngine:master Jun 25, 2014
rozza added a commit that referenced this pull request Jun 26, 2014
@yograterol
Copy link
Contributor

This is the last change that builded in Travis 74a3c44

I am seeing other changes.

@yograterol
Copy link
Contributor

Well, I don't understand that you mean. I don't find the meaning between what you're asking me and this PR. Sorry :(

@yograterol
Copy link
Contributor

Oh oh! Sorry! I get it!

The case is that all test with documents have fields with name like "name_field" or "name_field" and not "name_field", hence all test are run ok before and after of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants