Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses FormPack.FormField new property contextual name when create reports #2124

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dependencies/pip/dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pip-compile --output-file dependencies/pip/dev_requirements.txt dependencies/pip/dev_requirements.in
#
-e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest
-e git+https://github.com/kobotoolbox/formpack.git@6f39abc642920964b6fbcfae16deb4b935956ad3#egg=formpack
-e git+https://github.com/kobotoolbox/formpack.git@f0ddf7d68b792cdf7c59101ee79dc631bbcd3d0b#egg=formpack
amqp==2.1.4
anyjson==0.3.3
argparse==1.4.0 # via unittest2
Expand Down
2 changes: 1 addition & 1 deletion dependencies/pip/external_services.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pip-compile --output-file dependencies/pip/external_services.txt dependencies/pip/external_services.in
#
-e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest
-e git+https://github.com/kobotoolbox/formpack.git@6f39abc642920964b6fbcfae16deb4b935956ad3#egg=formpack
-e git+https://github.com/kobotoolbox/formpack.git@f0ddf7d68b792cdf7c59101ee79dc631bbcd3d0b#egg=formpack
amqp==2.3.2
anyjson==0.3.3
argparse==1.4.0 # via unittest2
Expand Down
2 changes: 1 addition & 1 deletion dependencies/pip/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/bndr/pipreqs is a handy utility, too.

# Formpack
-e git+https://github.com/kobotoolbox/formpack.git@6f39abc642920964b6fbcfae16deb4b935956ad3#egg=formpack
-e git+https://github.com/kobotoolbox/formpack.git@f0ddf7d68b792cdf7c59101ee79dc631bbcd3d0b#egg=formpack

# More up-to-date version of django-digest than PyPI seems to have.
# Also, python-digest is an unlisted dependency thereof.
Expand Down
2 changes: 1 addition & 1 deletion dependencies/pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# pip-compile --output-file dependencies/pip/requirements.txt dependencies/pip/requirements.in
#
-e git+https://github.com/dimagi/django-digest@0eb1c921329dd187c343b61acfbec4e98450136e#egg=django_digest
-e git+https://github.com/kobotoolbox/formpack.git@6f39abc642920964b6fbcfae16deb4b935956ad3#egg=formpack
-e git+https://github.com/kobotoolbox/formpack.git@f0ddf7d68b792cdf7c59101ee79dc631bbcd3d0b#egg=formpack
amqp==2.3.2
anyjson==0.3.3
argparse==1.4.0 # via unittest2
Expand Down
12 changes: 6 additions & 6 deletions kobo/apps/reports/report_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def data_by_identifiers(asset, field_names=None, submission_stream=None,
_all_versions = pack.versions.keys()
report = pack.autoreport(versions=_all_versions)
fields_by_name = OrderedDict([
(field.name, field) for field in
(field.contextual_name, field) for field in
pack.get_fields_for_versions(versions=_all_versions)
])
if field_names is None:
Expand Down Expand Up @@ -157,15 +157,15 @@ def _stat_dict_to_array(stat, field_name):
'percentages': percentages})

def _package_stat(field, _, stat, split_by):
identifier = kuids.get(field.name)
identifier = kuids.get(field.contextual_name)
if not split_by:
_stat_dict_to_array(stat, field.name)
_stat_dict_to_array(stat, field.contextual_name)
elif 'values' in stat:
for _, sub_stat in stat['values']:
_stat_dict_to_array(sub_stat, field.name)
_stat_dict_to_array(sub_stat, field.contextual_name)
return {
'name': field.name,
'row': {'type': fields_by_name.get(field.name).data_type},
'name': field.contextual_name,
'row': {'type': fields_by_name.get(field.contextual_name).data_type},
'data': stat,
'kuid': identifier,
'style': specified_styles.get(identifier, {}),
Expand Down
2 changes: 0 additions & 2 deletions kpi/utils/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ def get_default_logger():
# logging does not print to stdout when RAVEN/sentry is activated.
# To avoid to call logging.getLogger everywhere, we overload logging
logging = get_default_logger()