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

OpenTreeMap / otm-core / 2991
84%
develop: 84%

Build:
Build:
LAST BUILD BRANCH: dependabot/npm_and_yarn/sockjs-0.3.21
DEFAULT BRANCH: develop
Ran 30 May 2017 11:38PM UTC
Jobs 1
Files 216
Run time 11s
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
2991

push

travis-ci

RobinIsTheBird
upgrade HStore

Overview
--------

The point of this commit is to switch from
`django_hstore.fields.DictionaryField` to
`django.contrib.postgres.fields.HStoreField`.

The former is incompatible with later releases of django,
and OpenTreeMap needs to migrate from the current 1.8 to 1.11
for stability.

The latter is the sanctioned django interface to PostgreSQL's hstore
going forward.

The latter is also less functional than the former, prompting a series
of other changes.
Changes were also made for the sake of maintenance simplicity.

The key changes here are in `treemap.udf`, `treemap.audit`, `*.models`, and
`treemap.search`.

**treemap.udf**

Entry points:
-   `UDFModel`, a base class for models that need user defined fields
-   `UserDefinedFieldDefinition`, defines the name, data type, and model type
    for a user defined field, for a given treemap instance, as a
    scalar or a collection
-   `UserDefinedCollectionValue`, an HStore collection value for a
    specific `UserDefinedFieldDefinition` on a specific model instance

`UDFModel` user guide:

Classes that want custom fields subclass `UDFModel`.

To assign a custom field,
    `my_model_instance.udfs['custom field name'] = value`

There are three ways to retrieve it:
    `my_model_instance.udfs['custom field name']`
    `getattr(my_model_instance, 'custom field name')`
    `getattr(my_model_instance, 'udf:custom field name'`)

All of the above work for both scalar and collection custom fields.

Filter `UDFModel` subclass querysets using the `udf` transform.

In addition to the transforms and lookups described at
https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/,
`UDFModel` implements `__int` and `__float` transforms, for use
before magnitude comparisons (`__gt`, `__gte`, `__lt`, `__lte`).
Without them, comparison is lexical, which does not yield the
same results as a numerical comparison.

For example, to filter a queryset for a custom field value
corresponding to an integer ... (continued)

17435 of 20867 relevant lines covered (83.55%)

0.84 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
6
100.0
otm1_migrator/migration_rules/treezilla.py
54
100.0
importer/tests.py
Jobs
ID Job ID Ran Files Coverage
1 2991.1 30 May 2017 11:38PM UTC 0
83.55
Travis Job 2991.1
Source Files on build 2991
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2991
  • f7b4ede9 on github
  • Prev Build on rtb/hstore (#2988)
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