• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MongoEngine / mongoengine / 2882
94%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2019 09:15AM UTC
Jobs 2
Files 26
Run time 9min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2882

push

travis-ci

web-flow
Better management of the automatic "_cls" field (#2112)

* Rename BaseQuerySet._initial_query to BaseQuerySet._cls_query

This new name more accurately reflects the purpose of the dict. It is either
empty for documents that don't use inheritance or it contains a `{"_cls": ...}`
shape query. There was nothing "initial" about it per se.

* Drop read_preference as a kwarg on BaseQuerySet.__call__/filter

It was a poor design choice to offer two different ways to do the same thing:
1. `SomeDoc.objects(foo=bar, bar=baz).read_preference(...)`
2. `SomeDoc.objects(foo=bar, bar=baz, read_preference=...)`

Option 1 is good because it's immediately obvious which part defines the query
to be used and which part defines the read preference.

Option 2 is bad because you don't immediately know whether `read_preference`
is a query kwarg or a reserved keyword with some special behavior. If you
wanted to be particularly cruel, you could even write
`SomeDoc.objects(foo=bar, read_preference=..., bar=baz)`.

THIS IS A BREAKING CHANGE. From now on you have to use the
`BaseQuerySet.read_preference(...)` method.

* Add a BaseQuerySet.clear_cls_query method + get rid of the class_check kwarg

This is similar to what the previous commit did to read preference except that
in this case we were still missing a `BaseQuerySet` method for clearing the
`_cls` query.

Now, instead of the undocumented, untested, and confusing interface:
    `ParentDoc.objects(foo=bar, bar=baz, class_check=False)`
We do:
    `ParentDoc.objects(foo=bar, bar=baz).clear_cls_query()`

13 of 13 new or added lines in 1 file covered. (100.0%)

4917 of 5279 relevant lines covered (93.14%)

1.86 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2882.1 (MONGODB=${MONGODB_3_4} PYMONGO=3.x) 03 Jul 2019 09:15AM UTC 0
93.14
Travis Job 2882.1
7 2882.7 (MONGODB=${MONGODB_3_4} PYMONGO=3.4.x) 03 Jul 2019 09:24AM UTC 0
93.12
Travis Job 2882.7
Source Files on build 2882
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2882
  • 50555ec7 on github
  • Prev Build on master (#2878)
  • Next Build on master (#2883)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc