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

allegro / ralph / 7891 / 3
85%
ng: 85%

Build:
DEFAULT BRANCH: ng
Ran 26 Apr 2017 10:33AM UTC
Files 230
Run time 18s
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

26 Apr 2017 10:19AM UTC coverage: 84.807% (+0.02%) from 84.785%
DJANGO_VERSION=1.8.18 TEST_DB_ENGINE=psql

push

travis-ci

web-flow
Handle m2m prefetching in polymorphic (#3035)

To properly handle m2m prefetching of polymorphic objects (ex. `Operation.objects.prefetch_related(Prefetch(BaseObject.polymorphic_objects.all()))`), the following steps had to be added to polymorphic iterator:
* copying extra fields from base queryset
* copying filters from base queryset, to properly handle joins - this could be optimized in the future to not add unnecessary `WHERE` statements to SQL query.

* Fix `polymorphic_objects` in prefetch related, when base model is filtered

Based on example with Operation and BaseObject: it happened,
that when Operation objects were filtered, `polymorphic_filter`
still contains `Operation.objects.all()`, so all BaseObjects with
particular id(s) which have corresponding Operation (any! not only
the ones filtered in base query) were fetched from DB - but (here
comes the magic!) we were iteration through PKs of objects (BaseObject)
from original query and yield them in the same amount as they occur in
original query (so if there were 3 BaseObjects with PK 1234 in
original query, a lot more objects could be fetched, but only 3
of them were returned, and they might not correspond to current query
of base model (Operation)).

Right now, every fetched object is returned.

12247 of 14441 relevant lines covered (84.81%)

0.85 hits per line

Source Files on job 7891.3 (DJANGO_VERSION=1.8.18 TEST_DB_ENGINE=psql)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 7891
  • Travis Job 7891.3
  • 756663a8 on github
  • Prev Job for DJANGO_VERSION=1.8.18 TEST_DB_ENGINE=psql on ng (#7883.3)
  • Next Job for DJANGO_VERSION=1.8.18 TEST_DB_ENGINE=psql on ng (#7892.3)
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