-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix date issues when user inputs: date out of bound or date_to earlier than date_from #33
Merged
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
79cb2e7
Out of range date fix for DataBox view
toropok b980571
Update databox_controls.pt
toropok 803fd3b
date properties added
toropok a84fc46
Update databox_controls.pt
toropok e8c1d57
Update databox.py
toropok f7061c9
Update databox.py
toropok fcb273e
Update view.py
toropok 3746265
Update view.py
toropok 3c7b87b
Update view.py
toropok f920936
Update databox.py
toropok d3d626a
Update databox.py
toropok 53bb88d
Update Changelog.rst
toropok 9cae2c9
Update Changelog.rst
toropok 25f1c19
Update view.py
toropok e626688
Merge branch 'master' into patch-3
ramonski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
Does it have a reason why you added the import at class level?
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.
I recall the reason was that
dtime
was unreachable from a template expression statement, if import statement declared for module level..Would you think its better to return import statement to the module level and provide sort of wrapper from
DataBoxView
class to that template expression? Or even somehow importdtime
right in template (is that possible?)?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.
Ok, that's strange... Maybe this is because of restricted Python, but not sure.
Anyhow, I think that accessing the module directly is bad style and should be avoided.
Better create two more property methods in the class, that return the right value for you, e.g.:
And use then this in your template:
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.
Thanks! I've added properties.
Also, I've added
date_to > date_from
comparison, which should make report behaviour more intuitive. In case user putsdate_to
earlier than date_from - we use[date_from, date_from]
range for date query.