-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support query by date_modified field (#2009)
* Test that it's possible to filter by date_modified * Add "_date_modified" into Instance JSON * Add 'created' attribute to Data list XML representation * Format files * Add '_date_modified' to the ADDITIONAL_COLUMNS list * Add `DATE_MODIFIED` into the METADATA_FIELDS list * Update tests * Check if date_modified is null * Format files * Modify ordering of additional labels * Set '_date_modified' to the `date_created` value if not set on Instance * Update tests * Format files * Update test fixtures - Add '_date_modified' header * Update tests * Add '_date_modified' to the XForm headers list * Format date_created value before assigning to _date_modified field * Update tests Retrieve _date_modified value from the actual CSV * Update documentation Add the _date_modified field to the sample data for the Data endpoint * Set date_modified to date_created if null * Trigger CI tests
- Loading branch information
Showing
17 changed files
with
182 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# pylint: skip-file | ||
# Generated by Django 2.2.16 on 2021-02-02 07:48 | ||
|
||
from django.db import migrations | ||
from onadata.apps.logger.models.instance import Instance | ||
|
||
|
||
def regenerate_instance_json(apps, schema_editor): | ||
""" | ||
Regenerate Instance JSON | ||
""" | ||
for inst in Instance.objects.filter(deleted_at__isnull=True): | ||
inst.json = inst.get_full_dict(load_existing=False) | ||
inst.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('logger', '0061_auto_20200713_0814'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(regenerate_instance_json) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
"_id", | ||
"_uuid", | ||
"_submission_time", | ||
"_date_modified", | ||
"_tags", | ||
"_notes", | ||
"_review_status", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
"_id", | ||
"_uuid", | ||
"_submission_time", | ||
"_date_modified", | ||
"_tags", | ||
"_notes", | ||
"_version", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.