datasets - update station ID input for custom subset requests - #751
Open
tcram wants to merge 10 commits into
Open
datasets - update station ID input for custom subset requests#751tcram wants to merge 10 commits into
tcram wants to merge 10 commits into
Conversation
…plates to display label
…te to use form fields
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the way station IDs are handled in the dataset forms and related frontend code, improving consistency and allowing for both 5- and 6-digit WMO numbers. The main changes include renaming the field, updating validation, and ensuring all references use the new field name.
Form and Validation Updates:
station0tostationIDsindatasets/forms.py, and updated validation to accept both 5- and 6-digit WMO numbers. The label and widget attributes were also updated for clarity and consistency.Frontend and Template Consistency:
datasets/static/datasets/js/BUFR_subset.js) to use the newstationIDsfield instead ofstation0.custom-subset-page-d351000.htmlandcustom-subset-page-d461000.htmlto use the newstationIDsform field, replacing the previous manual label and textarea with the Django form field rendering. [1] [2]This pull request updates the station ID input field in the custom subset forms to use the Django form rendering system and improves form validation and labeling. The most important changes are:Form rendering and validation improvements:
custom-subset-page-d351000.htmlandcustom-subset-page-d461000.htmlis now rendered using{{ form.station0 }}instead of a manually coded<textarea>, ensuring consistent rendering and validation. [1] [2]station0field indatasets/forms.pynow enforces a minimum length of 5 characters, updates the label to "Station IDs (comma-separated)", and explicitly sets the field'sidattribute for better accessibility and consistency.