Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Checks only the model fields/fails with extra fields in the query set #8

Open
atodorov opened this Issue · 0 comments

1 participant

@atodorov

Hi,
I got this error:

chartit/validation.py" in _validate_field_lookup_term
  32.                          % (terms[0], ', '.join(model_fields)))

Exception Type: APIInputError at /..../
Exception Value: Field 'added' does not exist. Valid lookups are comment, id, key, metric, milestone, when_added.

The relevant code is:

metricsdata = DataPool(
        series= [{'options': { 'source': InternalTimedMetrics.objects.extra(select={'added': "DATE_FORMAT(when_added,'%Y-%m-%d')"}).filter(key=METRIC_APPS_ACTIVE) },
                'terms': [ 'metric', 'added']
                }
            ]
        )

#Step 2: Create the Chart object
cht = Chart(
        datasource = metricsdata,
        series_options =
          [{'options':{
              'type': 'line',
              'stacking': False},
            'terms':{
              'added': ['metric']
              }}]
        )

I'm trying to workaround the fact that datetime is not supported for X axis by converting the values to string right in the DB layer but your sanity checks got me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.