-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(analytics): add support for form name extraction
While at it, for better "generic" extraction, we now also allow extracting answers from documents without specifying the form in the data source, using `document[*].answer_slug` syntax. Note: This is kind-of breaking, because we replaced the `form_id` field on documents by `caluma_form.slug`. However, it's not "officially" breaking as the analytics part is still considered unstable.
- Loading branch information
Showing
9 changed files
with
6,921 additions
and
1,915 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
caluma/caluma_analytics/migrations/0006_rename_form_slug_fields.py
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,21 @@ | ||
# Generated by Django 3.2.15 on 2022-11-25 16:22 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def rename_form_slug_fields(apps, schema_editor): | ||
AnalyticsField = apps.get_model("caluma_analytics.AnalyticsField") | ||
for field in AnalyticsField.objects.filter(data_source__endswith="form_id"): | ||
field.data_source = field.data_source.replace("form_id", "caluma_form.slug") | ||
field.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("caluma_analytics", "0005_analytics_field_ordering"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(rename_form_slug_fields, migrations.RunPython.noop) | ||
] |
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.