Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c972c757
Commit
c972c757
authored
Nov 04, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise an OverflowError to be in parity with DateIndex.
parent
23beb872
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
...n/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
+3
-3
lib/python/Products/PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py
...PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py
+1
-1
No files found.
lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
View file @
c972c757
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
##############################################################################
##############################################################################
"""$Id: DateRangeIndex.py,v 1.
9 2003/11/04 14:53:28
chrism Exp $
"""$Id: DateRangeIndex.py,v 1.
10 2003/11/04 22:04:09
chrism Exp $
"""
"""
import
os
import
os
...
@@ -406,8 +406,8 @@ class DateRangeIndex(UnIndex):
...
@@ -406,8 +406,8 @@ class DateRangeIndex(UnIndex):
if
isinstance
(
value
,
DateTime
):
if
isinstance
(
value
,
DateTime
):
value
=
value
.
millis
()
/
1000
/
60
# flatten to minutes
value
=
value
.
millis
()
/
1000
/
60
# flatten to minutes
result
=
int
(
value
)
result
=
int
(
value
)
if
isinstance
(
result
,
long
):
# this won't work
if
isinstance
(
result
,
long
):
# this won't work
(Python 2.3)
raise
Value
Error
(
'%s is not within the range of dates allowed'
raise
Overflow
Error
(
'%s is not within the range of dates allowed'
'by a DateRangeIndex'
%
value
)
'by a DateRangeIndex'
%
value
)
return
result
return
result
...
...
lib/python/Products/PluginIndexes/DateRangeIndex/tests/test_DateRangeIndex.py
View file @
c972c757
...
@@ -113,7 +113,7 @@ class DRI_Tests( unittest.TestCase ):
...
@@ -113,7 +113,7 @@ class DRI_Tests( unittest.TestCase ):
assert
work
.
getEntryForObject
(
result
)
==
match
.
datum
()
assert
work
.
getEntryForObject
(
result
)
==
match
.
datum
()
def
test_longdates
(
self
):
def
test_longdates
(
self
):
self
.
assertRaises
(
Value
Error
,
self
.
_badlong
)
self
.
assertRaises
(
Overflow
Error
,
self
.
_badlong
)
def
_badlong
(
self
):
def
_badlong
(
self
):
work
=
DateRangeIndex
(
'work'
,
'start'
,
'stop'
)
work
=
DateRangeIndex
(
'work'
,
'start'
,
'stop'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment