-
Notifications
You must be signed in to change notification settings - Fork 81
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
Generate mandatory XLS forms programmatically #324
Conversation
Update:Actually, there was a way to have multiple
|
That's huge!! We can easily have a disambiguation dialog to select the submission on the frontend then 🎉 💯 the workflow to choose - thanks for sticking to your guns and convincing me 😄 |
"list_name": "digitisation_problem", | ||
"name": "lumped", | ||
"label::english(en)": "Lumped - one polygon (more than one building digitized as one)", | ||
"label::swahili(sw)": "Lumped - poligoni moja (zaidi ya jengo moja limewekwa dijiti kuwa moja)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is perfect for now, but we should definitely consider moving all these translations out into a separate YAML or something, at some point.
This way users could update the translations via weblate or transifex (we will add this for UI translations soon anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I also thought about that 👍
# along with OSM-Fieldwork. If not, see <https:#www.gnu.org/licenses/>. | ||
# | ||
|
||
"""This script generates an XLS form with mandatory fields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely docstring 👍
"french": "fr", | ||
"spanish": "es", | ||
"swahili": "sw", | ||
"nepali": "ne", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌😁
If you can translate the other columns into Nepali then feel free to add them! (might help Tokha I imagine)
Merge whenever 👍 You can make and push a new release too cz bump --check-consistency
git push
git push --tag
#then release on github |
I will get back to it sooner. |
Summary
This pull request introduces a new feature to generate mandatory XLS forms directly within the codebase. It modularizes the workflow, making it easier to manage and scale form generation tasks.
Features
Added a modular structure to generate XLS forms:
mandatory_fields.py:
Defines essential fields for all forms.digitisation_fields.py:
Includes specific fields for digitization and verification processes.choice_fields.py:
Handles choices required for mandatory fields.Combined all components into a single pipeline to generate the final survey XLS form.
Key Improvements
Added
submission_id
caculation field to update entity property with latestsubmission_id
.Created a function
standardize_xlsform_sheets
which:and creates a standard language label for any kind of label present in the user-defined xls form consequently making a standard xls form.