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

burke-software / django-report-builder / 358
76%

Build:
DEFAULT BRANCH: master
Ran 02 Jul 2015 09:42PM UTC
Jobs 4
Files 15
Run time 32s
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
358

push

travis-ci

grantjenks
Merge pull request #186 from grantjenks/annotation_filters

Add max and min annoation filters.

Similar to group-by queries, annotation-filters allow you to display only the Max or Min of a set of rows.

Suppose we have two models, Person and Child. Each has first_name, last_name fields and Child has a foreign key to Person as parent. Child also has age and color fields. Already we can use the group-by mechanism to display each Person's count of children or the age of each person's oldest child.

Unfortunately, getting the related items of an aggregate is difficult in Django and SQL. Suppose in the example above that we want to know the name and age of each person's oldest child. With annotation-filters this can be done.

Annotation-filters are applied iteratively after normal queryset filtering. They work, as the name indicates, by applying Django's annotate and filter queryset methods. As they are self-referential, they do not accept a text input from the front-end.

Annotation-filters are difficult to describe conceptually so I'll use an example. To display the name and age of each person's oldest child, we begin by constructing a report based on Child. We add display fields for the parent name, child name, and child age. Then for filter fields, we add the parent__children__age field. This lengthy path indicates that children are to be grouped by their parent and with the type Max, only the maximum age of each group should be included.

We could extend this further by adding the filter field parent__children__color with type Equals Red to get a list of the oldest children of each person whose favorite color is red.

This change extends the tests based on Person and Child with coverage for the above described scenarios.

922 of 1187 relevant lines covered (77.67%)

3.11 hits per line

Jobs
ID Job ID Ran Files Coverage
1 358.1 (DJANGO_VERSION="django>=1.7,<1.8") 02 Jul 2015 09:42PM UTC 0
77.67
Travis Job 358.1
2 358.2 (DJANGO_VERSION="django>=1.8,<1.9") 02 Jul 2015 09:42PM UTC 0
77.59
Travis Job 358.2
3 358.3 (DJANGO_VERSION="django>=1.7,<1.8") 02 Jul 2015 09:42PM UTC 0
77.67
Travis Job 358.3
4 358.4 (DJANGO_VERSION="django>=1.8,<1.9") 02 Jul 2015 09:42PM UTC 0
77.59
Travis Job 358.4
Source Files on build 358
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #358
  • 95eec8de on github
  • Prev Build on master (#349)
  • Next Build on master (#360)
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